5

I have a C# console app which I'm deploying around 20 times (with different config settings) and running. As you might imagine it's hard to keep an eye on what's happening with 20 apps running (I'm eventually going to deploy these as windows services), so is there anything that can show the output of these in one place easily?

I've thought about log files but these could get big quite fast, and it is a lot of files to open and look at - I just want to have some output to check things are still running as expected.

Edit:

I'm going to be writing errors and stop/start information to the database. What I'm talking about here is the general processing information, which isn't all that relevant to revisit, but interesting to look at while its running in the console app.

4
  • Even if they all log to the same place? Database?
    – Widor
    Sep 20, 2011 at 11:33
  • I'm not too worried about where they all log gereral info to (I agree for errors), more concerned with having a look at how each is getting on. If they are carrying out tens of thousands of actions a day, I don't necessarily want to write all that to the database (or a file) as I won't ever need to see it again.
    – finoutlook
    Sep 20, 2011 at 11:51
  • 2
    Have a look at log4net and the appenders it offers. It's really easy once you get it set up. And with Upd, the datagrams disappear into cyberspace if there is no one listening. Sep 20, 2011 at 11:54
  • I think the appenders in Log4net are the way to go, allowing me to change the output to different places if changes are needed later. Thanks for the help.
    – finoutlook
    Sep 21, 2011 at 9:02

3 Answers 3

4

I have successfully used log4net and its configurable UdpAppender. Then you can point all the UdpAppenders to a single machine where you can receive the Udp messages with Log4View for example.

Since it's configurable, you can use it when you install and debug in production and then increase the logging level to only output ERROR messages instead of DEBUG or INFO messages.

http://logging.apache.org/log4net/

http://www.log4view.com

http://logging.apache.org/log4net/release/config-examples.html

2

Maybe because I come from a heavy DB background, but how about using SQL Server with a Log table to track activity across different apps?

DBs are geared up towards concurrency and will easily handle multiple applications inserting data into the same Log table, also you get the options of slicing and dicing through the data as much as you would like, taking advantage of the already existing aggregation functions in a DB environment.

If you go down that route, you will probably need to consider maintaining that table (Log retention period, etc.).

You could also potentially start using tools such as Splunk to collate all the log data, and start corresponding app failures to system or environment failures (if these are being tracked).

0

I'd second Mikael Östberg and recommend using a logger library (log4net, or nlog). There are many options where you can send messages to either a database or queues, etc... Since you can turn the logging on or off easily, you can even keep it in your services as a monitor hook in case something weird happens

1
  • What I'm looking for is a way to monitor those logs if I want to check what's currently happening. Even assuming I go for Log4net - how will I visualise the output, will I have to select from a dropdown twenty times to view each app, or is there something that can collate them all on one page.
    – finoutlook
    Sep 20, 2011 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.