Skip to main content

We are creating custom logs in some of our rules services.

Currently, that is done using the StreamWriter class in a C# component, which can cause problems if multiple engines are trying to write to the same log file at the same time.

Anyone have any recommendations for a logging framework which we can use in a rules service?

Hi Marc,

Streamwriter can indeed give issues as mentioned in https://stackoverflow.com/questions/19304209/streamwriter-multi-threading-c-sharp i’ve heard from Robert H.

 

There is an existing OTS syslog component for logging purposes, maybe this is something to consider as an example? The component is found on Github:

https://github.com/USoftRD/OffTheShelfs/tree/10.0/OTS_SYSLOG_CLIENT_RFC3164

The related article is:

 


Thanks, Dara, I will see if we can use this as a starting point.


I eventually ended up using Apache log4net, which seems to work well, and which obviously has many similarities with the log4j2 logging used by the Service Framework.


Ahh nice @marc  , good to know of,  looks indeed suitable to me!


Reply