You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Jayamani <ja...@gmail.com> on 2019/10/03 12:56:58 UTC

Overriding default log directory

Hi,
 i am new to karaf 4.2.3, i like to keep my log file in custom folder , i am
not able to find any key in org.ops4j.pax.logging.cfg to change default log
directory, which has log4j2 appender's but in documentation only log4j
appender's available., please let me know if there is any way to change
default log directory



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html

Re: Overriding default log directory

Posted by Jayamani <ja...@gmail.com>.
Thanks, 
Jean-Baptiste.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html

Re: Overriding default log directory

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

you have two ways to do that:

1. you can change the KARAF_LOG variable in bin/setenv
2. you can update etc/org.ops4j.pax.logging.cfg as this:

log4j2.appender.rolling.fileName = /path/of/your/choice/your.log
log4j2.appender.rolling.filePattern = /path/of/your/choice/your.log.%i

You can also add your own appender for some specific logger.

NB: the second configuration can be performed via config:* Karaf commands.

Regards
JB

On 03/10/2019 14:56, Jayamani wrote:
> Hi,
>  i am new to karaf 4.2.3, i like to keep my log file in custom folder , i am
> not able to find any key in org.ops4j.pax.logging.cfg to change default log
> directory, which has log4j2 appender's but in documentation only log4j
> appender's available., please let me know if there is any way to change
> default log directory
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com