Skip to content

Nocktion/SBO-statusbar-for-NLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SAP Business One Status Bar target for NLog

A simple NLog target that writes out messages to the status bar in SAP Business One

Usage

Register the target in the LogManager

NLog.LogManager.Setup().SetupExtensions(s =>
   s.RegisterTarget<SAPStatusBarTarget>("SAPStatusBar")
);

Once you have connected to the SBOGui and have the Application, add the rule to your LoggingConfiguration

var logSapStatusBar = new SAPStatusBarTarget(SBO_Application)
logSapStatusBar.Layout = "${logger}: ${message:withexception=false}"

config.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Error, logSapStatusBar)

And there you have it. The 3 LogLevels will be reflected in the status bar messages as well, Info will be written out as a Success, Warn as a Warning and Error as an Error.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published