| |

VerySource

 Forgot password?
 Register
Search
View: 1421|Reply: 1

About the configuration of Log4jConfigListener

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-15 18:30:01
| Show all posts |Read mode
Anxious for "Dynamic change of Log4jConfigListener logging level and policy, no need to restart the Web application" method. The details found on the Internet are not detailed enough. !! !! !! !!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-5 07:45:01
| Show all posts
<!-- Log4J configuration begin -->
<!--
If the webAppRootKey parameter is not defined, then webAppRootKey is the default "webapp.root". But it's best to set it to avoid name conflicts between projects.
After the definition, the absolute path of ROOT will be written into the system variable when the Web Container is started.
Then you can use ${webName.root} in the log4j configuration file to represent the absolute path of the Web directory, and store the log file in the webapp.
This parameter is used in the later "Log4jConfigListener"
-->
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>xx.root</param-value>
</context-param>
<!--
The path of the Spring ApplicationContext configuration file. Wildcards can be used, and multiple paths are separated by commas.
This parameter is used for the following "Spring-Context loader"
-->
<!--
context-param> <param-name>a</param-name> <param-value>
applicationContext.xml </param-value> </context-param
-->
<!--Log4j configuration file location loaded by Sprng-->
<!--
context-param> <param-name>log4jConfigLocation</param-name>
<param-value>log4j.properties</param-value> </context-param
-->
<!--Spring default refresh interval of Log4j configuration file, unit is millisecond-->
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<!--Spring log4j Config loader-->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- Log4J configuration end -->
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list