Setting custom Log location - log4j

classic Classic list List threaded Threaded
6 messages Options
userx userx
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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.
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting custom Log location - log4j

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
userx userx
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting custom Log location - log4j

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.



vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting custom Log location - log4j

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
Mikhail Getmanov Mikhail Getmanov
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting custom Log location - log4j



--
Отправлено из мобильного приложения Яндекс.Почты

11:12, 11 августа 2017 г., vkulichenko <[hidden email]>:

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.
Mikhail Getmanov Mikhail Getmanov
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting custom Log location - log4j



--
Отправлено из мобильного приложения Яндекс.Почты

19:19, 11 августа 2017 г., Mikhail Getmanov <[hidden email]>:


--
Отправлено из мобильного приложения Яндекс.Почты

11:12, 11 августа 2017 г., vkulichenko <[hidden email]>:

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.

Loading...