aaOpenSource / aaLog

A library and example programs for reading the standard SMC log file format
MIT License
13 stars 15 forks source link

Program logging to stdout #13

Closed fledder closed 8 years ago

fledder commented 9 years ago

So when I first tried getting it to log to stdout, the aaLog logs themselves were coming out at debug level. In aaLogReader.cs, line 38 and 56 have

log4net.Config.BasicConfigurator.Configure();

which apparently overrides the settings in log.config and sends debug-level messages out stdout. Is there a reason we need that line? I commented it out and the std out works as expected; I will set the log levels to debug and see if the actual logging still works.

arobinsongit commented 9 years ago

We should be able to fine tune the Log4Net configuration to stop sending debugs to the stdout. I am definitely not a log4net master, more just got it doing what I needed to do.

logic-danderson commented 8 years ago

I ran into this, too, and agree that removing those two lines of code fixes it.

On a related note, I think this line should be removed from aaLogReader:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log.config", Watch = true)]

In my opinion that belongs in the hosting executable, not the library. The way it stands now the library is hard coded to use log.config, and maybe that's not what the application developer prefers. I tested it and logging still works without these lines in aaLogReader as long as the hosting app is configured correctly.

So that also involves log4net. Is it appropriate to include that here or should there be a separate issue for it? Either way, I'd be happy to work on a pull request (or separate pull requests) for these changes.

arobinsongit commented 8 years ago

I agree that including that in the library was a pretty dumb move. Maybe you could open a separate issue and issue a PR against that.

logic-danderson commented 8 years ago

Will do.

arobinsongit commented 8 years ago

David - your thoughts on closing this issue? I'm not certain if you addressed this in a separate issue?

logic-danderson commented 8 years ago

Yeah, it was handled by issue #21.

arobinsongit commented 8 years ago

Ok thanks. Closing issue since it was adressed with Issue #21