Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support for external log4net config files #434

Closed
AlexanderDzhoganov opened this issue Nov 21, 2014 · 3 comments
Closed

Provide support for external log4net config files #434

AlexanderDzhoganov opened this issue Nov 21, 2014 · 3 comments

Comments

@AlexanderDzhoganov
Copy link
Member

Currently installing a mod from the GUI with --debug results in a hundred megabytes log file. We should probably reduce the log spam at some point.

@pjf
Copy link
Member

pjf commented Nov 21, 2014

We're using log4net, which allows debugging from individual subsystems to be turned on and off, even while the program is running. Seriously. It's amazing: https://logging.apache.org/log4net/release/manual/configuration.html

Having said that, --verbose is usually more appropriate to figure out what's going on at a first glance. It'll list the important things (level INFO) rather than everything (level DEBUG).

In any case, we should set things up to allow for an external configuration file to be used. That means we can enable or disable debugging for just particular classes (really useful during development) rather than the entire programme.

@pjf pjf changed the title Reduce debug spam Provide support for external log4net config files Nov 23, 2014
@ayan4m1
Copy link
Contributor

ayan4m1 commented Aug 2, 2016

My proposed solution here would be checking a known location (e.g. CKAN/log4net.xml) during app bootstrap, then using an XmlConfigurator pointing to the filesystem or the resource-based path.

@HebaruSan
Copy link
Member

This seems to have been added in #1881. If I copy CKAN/GUI/log4net.xml to my _build folder, I get a CKAN.log file created when I run ckan.exe. If I change WARN to INFO, it contains some info:

2017-12-29 01:24:53 INFO CKAN.Main - Starting the GUI
2017-12-29 01:24:55 INFO CKAN.URLHandlers - Adding URL handler to registry
2017-12-29 01:24:55 INFO CKAN.URLHandlers - URL handler already exists with the same path
2017-12-29 01:24:56 INFO CKAN.Main - GUI started
2017-12-29 01:25:26 INFO CKAN.RelationshipResolver - Resolving relationships for MarkIVSpaceplaneSystem
2017-12-29 01:25:26 INFO CKAN.RelationshipResolver - Resolving dependencies for MarkIVSpaceplaneSystem
2017-12-29 01:25:26 INFO CKAN.RelationshipResolver - Resolving dependencies for B9PartSwitch
2017-12-29 01:25:26 INFO CKAN.RelationshipResolver - Resolving dependencies for ModuleManager
2017-12-29 01:25:26 INFO CKAN.RelationshipResolver - Resolving dependencies for CommunityResourcePack
2017-12-29 01:25:26 INFO CKAN.RelationshipResolver - Resolving dependencies for DeployableEngines
2017-12-29 01:25:27 INFO CKAN.RelationshipResolver - Resolving dependencies for FirespitterCore
...

If I change it to DEBUG, it spams my disk with 30+ MB of logs. Closing as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants