views:

212

answers:

2

I have a console project that I have been working on. I added log4net to handle all my logging. In some places I have made use of the console appender. When I turn this application into a Windows Service should I just remove the console appender or what happens to that output? Does it just get lost?

I would like to keep it if all possible because if I run it straight from the command prompt I would like to see the console output to help debug things.

+3  A: 

As a default behaviour, the console isn't available in windows services, web services, windows forms. The outpu will simply be dismissed.

Seb
A: 

As @Seb mentions, output to the console will go into the void. To have the best of both worlds (console AND e.g. saving to a file) you can easily set up two appenders, one console and say, one RollingFileAppender.

Keeping the console appender does not add significant overhead unless you are really doing high-volume logging.

Peter Lillevold