Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to organize centralized logging?

The situation is: we've got a number of working application instances, developed on C#. We want them to log in one place (that could be a file). As far as I know log4net and NLog can send logs via TCP. The problem is - how to listen to these logs and store it? Is there any working solution to collect these logs?

like image 525
verkholantsev Avatar asked Oct 23 '22 02:10

verkholantsev


2 Answers

In log4Net you shoul configure appender, here official documentation see RemotingAppender

For the listen TCP you should use TcpListener like in this resource, there are exist some clients for log4net like this

like image 148
Rustem Avatar answered Oct 27 '22 11:10

Rustem


In NLog you might consider the Database target. NLog has some other targets you might consider, including the LogReceiverService, which sends logging messages to a WCF Service or Web Service, where they can be logged to any of the NLog targets, including to a file.

In log4Net you might consider the AdoNetAppender. Configuration examples here.

I will note that, in the past, I implemented a WCF-based LoggingService (which is ultimately similar to NLog's LogReceiverService), which worked well for me.

like image 43
wageoghe Avatar answered Oct 27 '22 11:10

wageoghe