Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.15.0
-
None
-
None
Description
i was looking for a way to reconfigure the log of a high traffic web application via GUI or API. the application writes its log via log4j2 2.14.1 to stdout, and optionally into a file, rolling. the following i tried to do programmatically:
- change the log level, e.g. from ERROR to DEBUG.
- switch between writing to a log file, or not.
- save the current settings into a config file so next time the application comes up the settings still are active.
- reset to the factory settings.
if somebody knowledgeable could amend the documentation with how log4j2 supports to set a single value to a different value at runtime. add/remove parts of the configuration, reset all of the configuration to the factory settings would be helpful. maybe just add an overview glue, if the details are already there. the page i found was:
https://logging.apache.org/log4j/2.x/manual/customconfig.html
in this page the following method mentioned is deprecated:
Appender appender = FileAppender.createAppender("target/test.log", "false", "false", "File", "true","false", "false", "4000", layout, null, "false", null, config);