News combit Dev Blog

Introducing Enterprise Level Logging Support

Posted: Thursday, October 6, 2016 | 0 comment(s)
 
For you as an enterprise application developer, logging is probably one of the essential features of your app. It enables you to trace and see what the user did just before the app went blank, and see if the typical user answer "I haven't done anything" proves right or wrong. To support you in this task, logging was built into List & Label from the very start.

However, for you there was no easy way to have the List & Label log output in the same place with your own logs. To make things more complicated, server apps typically run with separate credentials, which makes logging to file an error-prone and tedious task.

Enter the new logging interface support. It enables you to easily grab all debug output from List & Label and use your "normal" logging channel. This way, no matter if you use log4net, NLog, Boost.Log or any of the other logging libraries out there, you can get the LL output right where it belongs. This feature will be supported out of the box for .NET and C++ - support for other languages will vary with their COM and VARIANT support. This is what you'd have to implement on the .NET side for a minimal logger:

public class MyLogger : LoggerBase
{
public override bool WantOutput(LogLevels level, LogCategory category) { /* ... */ }
public override void Debug(LogCategory category, string message, params object[] args) { /* ... */ }
public override void Info(LogCategory category, string message, params object[] args) { /* ... */ }
public override void Warn(LogCategory category, string message, params object[] args) { /* ... */ }
public override void Error(LogCategory category, string message, params object[] args) { /* ... */ }
} 

Any similarities to existing logger interfaces are purely coincidential, of course ;-). We ship wrappers for NLog and log4net, so all you have to do in order to plug the LL output into your existing loggers is

ILlLogger customLogger;
// use a NLog logger in List & Label
customLogger = new ListLabel2NLogAdapter(NLog.LogManager.GetLogger("LL.Export"));

// or use a log4net logger
customLogger = new ListLabel2Log4NetAdapter(log4net.LogManager.GetLogger("LL.Export"));

// or use your own implementation of ILlLogger
customLogger = new MyCustomLogger();

// Pass the logger to ListLabel and everything is set up
using (var LL = new ListLabel(customLogger))
{
    // use List & Label as usual
} 

Here's a screenshot of Apache Chainsaw capturing List & Label debug output:


Apache Chainsaw capturing List & Label

Besides offering the comfort of "everything in one place" this also greatly enhances the usability of List & Label logging in server applications.

And it's yet another feature that shows our commitment to our professional dev community. :-)

 




Author: Jochen Bartlau
Head of Development List & Label

Jochen Bartlau leads the development at combit as Managing Director. He's a Microsoft .NET enthusiast driving innovation & agile project management. The mobile devices geek who used to be a physicist in his first life loves to spend his spare time with his family.


  

RSS
combit Development BlogRSS
What’s this blog for?
A place to share updates about the ongoing development of our products. General musings on the software industry included.
Archive
January 2021 (1)
December 2020 (2)
November 2020 (1)
October 2020 (2)
September 2020 (1)
August 2020 (2)
July 2020 (1)
June 2020 (1)
May 2020 (2)
April 2020 (2)
March 2020 (2)
February 2020 (1)
January 2020 (1)
December 2019 (1)
November 2019 (2)
October 2019 (2)
September 2019 (2)
August 2019 (2)
July 2019 (2)
June 2019 (2)
May 2019 (1)
April 2019 (0)
April 2019 (1)
March 2019 (1)
February 2019 (1)
January 2019 (1)
December 2018 (1)
November 2018 (2)
October 2018 (4)
September 2018 (4)
August 2018 (2)
July 2018 (2)
June 2018 (2)
May 2018 (1)
April 2018 (1)
March 2018 (1)
February 2018 (2)
January 2018 (1)
December 2017 (1)
November 2017 (2)
October 2017 (3)
September 2017 (3)
August 2017 (2)
July 2017 (2)
June 2017 (1)
May 2017 (2)
April 2017 (1)
March 2017 (1)
February 2017 (1)
January 2017 (2)
December 2016 (1)
November 2016 (1)
October 2016 (4)
September 2016 (5)
August 2016 (2)
July 2016 (2)
June 2016 (3)
May 2016 (2)
April 2016 (3)
March 2016 (3)
February 2016 (1)
January 2016 (2)
December 2015 (2)
November 2015 (1)
October 2015 (4)
September 2015 (5)
August 2015 (2)
July 2015 (2)
June 2015 (2)
May 2015 (1)
April 2015 (2)
March 2015 (1)
February 2015 (1)
January 2015 (1)
December 2014 (2)
November 2014 (1)
October 2014 (1)
September 2014 (2)
August 2014 (1)
July 2014 (2)
June 2014 (1)
May 2014 (2)
April 2014 (1)
March 2014 (2)
+1 800 256 3608 (toll-free North America only)