By default, GridGain comes with its own copy of log4j configuration in the form of "default-log4j.xml" GridGain does not allow usage of log4j.properties as GridLog4jLogger only accepts XML file as source of configuration.
However, like me, if you are adding GridGain to an application that has logging already configured using log4j.properties, then, you can use below workaround.
In the below example, we are setting gridLogger property of Grid Configuration by using an
instance of GridLogger that is constructed using a regular log4j Logger object.
Then, we have log4jInitialization bean that initialzes log4j using
log4j.properties with the help of org.springframework.util.Log4jConfigurer.
However, like me, if you are adding GridGain to an application that has logging already configured using log4j.properties, then, you can use below workaround.
In the below example, we are setting gridLogger property of Grid Configuration by using an
instance of GridLogger that is constructed using a regular log4j Logger object.
Then, we have log4jInitialization bean that initialzes log4j using
log4j.properties with the help of org.springframework.util.Log4jConfigurer.


0 comments:
Post a Comment