We are using log4net with rolling file appender.
As we are using load balancing servers log files are generated on both the of the servers and looking at them is of a lot problem.
We are thinking of some centralisied logging which can hold all the logs of different components at one place and if required can be viewed with some log viewer or a customised UI.
We have some proposed solutions to it
More suggestion please post it..
log4net doesn't support the concept of structured logging. Like shown in the conversionPattern element in the XML configuration, you have some variables to play with when writing to the storage. But including properties like FirstName in the Serilog example isn't available.
Log4net is a logging utility for . NET applications. It's based on log4j, which is for Java applications. Log4net is highly configurable, so you can use it in many scenarios.
Log4net has three main components: loggers, appenders and layouts. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported.
A simple solution is to use Syslog, using the RemoteSyslogAppender
Once you have a Syslog server setup you can use this 'out of the box', with no need for the additional work required using ADO, WCF or MSMQ
A good Syslog server for Windows is Kiwi, with both free and commercial (has more functionality than the free version) versions available. Kiwi comes with a viewer as well.
You can use, for example, a UdpAppender or a RemotingAppender to send the logged events over a network to a central point which logs them to disk. Note that the UDP version can drop messages under heavy network load, as UDP does not offer delivery guarantees.
Alternatively, you could base a TcpAppender class on UdpAppender which uses TCP rather than UDP - providing a reliable delivery service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With