7 Replies Latest reply: Feb 17, 2011 10:21 PM by Rich Raposa RSS

How to change logfile dir?

ssl oss Newbie

Hi.

 

Does anyone know how to change the logfile directory? By default, some log files are output in /log dir.

How can I change the directory of log files, except for catalina.out?

 

Thank you,

Kenta

  • 1. How to change logfile dir?
    Rich Raposa Novice

    JBoss uses log4j, and all the configuration settings are in jboss-log4j.xml.

     

    The path and filename of the log file is in there. Look for the <appender name="file"> tag and change the path there.

     

    You can also specify a runtime parameter - something like:

     

    run.sh -Djboss.server.log.dir=/my/logs

  • 2. How to change logfile dir?
    ssl oss Newbie

    Hi, Rich.

     

    Thank you for your quick responce.

     

    I am sorry. I am using Tomcat, not JBoss...(I should have mentioned)

    So...please help if you know how for Tomcat...

     

    Thank you,

    Kenta

  • 3. How to change logfile dir?
    Rich Raposa Novice

    Oh - sorry. I'm just so used to thinking in terms of JBoss, I didn't consider that you might be running GateIn on Tomcat!

     

    So you are going to want to edit the /conf/logging.properties. You will see the log paths defined in there.

     

    Rich

  • 4. How to change logfile dir?
    ssl oss Newbie

    Hi Rich.

     

    Thank you for your quick response.

     

    I could change the log directories as you told me!  By the way, do you know how to

    change the format of the log file name? (default is: admin.YYYY-MM-DD.log. change

    this to admin.<SOMETHING>.log)

     

    Also, it seems like daily log rotation is working.

    I want to know how to change the rotation period (like weekly).

     

    Thank you,

    Kenta

  • 5. How to change logfile dir?
    Rich Raposa Novice

    I think that's an operating system question. In other words, you're looking at cron, logrotate, etc. Are you running this on Linux?

  • 6. How to change logfile dir?
    ssl oss Newbie

    Hi, Rich.

     

    I am running it on Linux(CentOS 5.5).(Gatein-3.1.0-FINAL-tomcat)

     

    However, there's no log rotation settings of 'logrotate' for tomcat or gatein. So I am wondering if

    the rotation of gatein's log files are managed by log4j which gatein uses.(Unfortunatelly, I'm not

    familier with log4j...)

     

    If this is the case, I think there should be some configuration files somewhere in gatein directories,

    and this is where my question comes from.

     

    If my guess is not right, please let me know...

     

    Thank you,

    Kenta

  • 7. How to change logfile dir?
    Rich Raposa Novice

    Kenta,

     

    I was thinking more of the Tomcat log files and how you can use Linux's logrotate to rotate those files.

     

    You can also configure the logging for the Gatein application - but that let's you configure the format/pattern of the log entries. Those settings are in /portal/WEB-INF/conf/common/logs-configuration.xml. But I don't think you can specify rotating in there.

     

    Hope that helps!

     

    Rich