You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by userx <ga...@gmail.com> on 2017/08/10 18:01:16 UTC

Setting custom Log location - log4j

Hi all,

I intend to use log4j for Apache Ignite logging. The steps I followed are

1) add maven dependency of 
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-log4j</artifactId>
<version>2.0.0</version>

2) set the following in IgniteConfiguration file
		<property name="gridLogger">
			<bean class="org.apache.ignite.logger.log4j.Log4JLogger">
				<constructor-arg type="java.lang.String" value="config/ignite-log4j.xml"
/>
			</bean>
		</property>
3) When I start the server, it generates log at $IGNITE_HOME/work location.
I put in a debug point to see if Log4JLogger is getting instantiated and it
does.

4) Then I set an environment variable in eclipse say LOG_HOME and replaced
IGNITE_HOME with the same.
When I restarted the server it is still writing at IGNITE_HOME. 

How can I change the location of my Ignite logs to a custom location I have
set up in eclipse environment variables ? I intend to use the same strategy
and let WAL happen at a custom location as well.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Setting-custom-Log-location-log4j-tp16106.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Setting custom Log location - log4j

Posted by vkulichenko <va...@gmail.com>.
This simply means that environment variable is not picked up by the process.
If you run in Eclipse, probably you just need to restart it.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Setting-custom-Log-location-log4j-tp16106p16121.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Setting custom Log location - log4j

Posted by userx <ga...@gmail.com>.
Hi Val,

Can you help me out with the configuration change for log4j ? I have
provided the value of LOG_HOME in environment variables in eclipse. Here is
what I have
    <appender name="FILE"
class="org.apache.ignite.logger.log4j.Log4jRollingFileAppender">
        
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

I am having similar problem setting persistentStorePath property, 

<property name="persistentStoreConfiguration">
			<bean
class="org.apache.ignite.configuration.PersistentStoreConfiguration">
		<property name="persistentStorePath"
value="${LOG_HOME}/PersistentStore"></property>
			</bean>
</property>

If I put the debug point in setPersistentStore method what I receive there
is ${LOG_HOME}/PersistentStore
rather than C:\\users which is the value of environment variable LOG_HOME.

This is quite a problem for me.







--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Setting-custom-Log-location-log4j-tp16106p16118.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Setting custom Log location - log4j

Posted by vkulichenko <va...@gmail.com>.
Path for log files is ${IGNITE_HOME}/work/log/, as specified in the log4j
file. If log4j logger is used and if configuration was not changed, then
most likely the change to IGNITE_HOME property variable you made was not
picked by the process. You can check it in the log - Ignite prints out
IGNITE_HOME value on startup.

However, if the purpose of this is to only change log files location, then
it's better to modify file appender ignite-log4j.xml.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Setting-custom-Log-location-log4j-tp16106p16111.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.