customising location of log files

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

customising location of log files

Jakob Fix-2
Hello,

I'd like to have my log files at a different location than
WEB-INF/logs.  I've looked into the WEB-INF/log4j.xml file.
Obviously, I could just change the settings for the param File to
  <param name="File" value="[my location]/xmldb.log"/> etc.
but the original line is
  <param name="File" value="${logger.dir}/xmldb.log"/>
which looks rather promising, as it seems to me that logger.dir could
be an Ant property that can be specified in a .properties file.
However, I (or rather Eclipse's search feature) couldn't find any
mentioning of this property other than in the Log4jInit.class.

Is there an easy way to simply change this property instead of
modifying the log4j.xml file?

--
cheers,
Jakob.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: customising location of log files

Dannes Wessels
Hi,

> ${logger.dir}
> Is there an easy way to simply change this property instead of
> modifying the log4j.xml file?

logger.dir is a System property, that is set by eXist internally. As
far as I know you can not override it right now.........

regards

Dannes


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: customising location of log files

Jakob Fix-2
Thanks Dannes,

On 24/10/05, Dannes Wessels <[hidden email]> wrote:
> Hi,
>
> > ${logger.dir}
> > Is there an easy way to simply change this property instead of
> > modifying the log4j.xml file?
>
> logger.dir is a System property, that is set by eXist internally. As
> far as I know you can not override it right now.........

ok, I'll have to continue to use an Ant task that modifies the file directly.

--
cheers,
Jakob.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: customising location of log files

Jakob Fix-2
In reply to this post by Jakob Fix-2
Hi Tobias,

On 24/10/05, Tobias Wunden <[hidden email]> wrote:
> Hi Jakob,
>
> without having a look at Log4jInit, you are able to specify
> environment variables in tools/jetty/etc/jetty.conf. You have there a
> few examples where exist.home is beeing specified. Maybe this can do
> the trick for you as well.

Ah, you mean, I could define the logger.dir somewhere on the command
line, for example in  the bin/startup.bat file, where I currently have

set JAVA_OPTS="-Xms64000k -Xmx512000k -Djetty.port=%JETTY_PORT%
-Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"

I could just add another -Dlogger.dir=.... ?  I'll try that and report
back.  Thanks.

--
cheers,
Jakob.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: customising location of log files

Jakob Fix-2
On 24/10/05, Jakob Fix <[hidden email]> wrote:

> Hi Tobias,
>
> On 24/10/05, Tobias Wunden <[hidden email]> wrote:
> > Hi Jakob,
> >
> > without having a look at Log4jInit, you are able to specify
> > environment variables in tools/jetty/etc/jetty.conf. You have there a
> > few examples where exist.home is beeing specified. Maybe this can do
> > the trick for you as well.
>
> Ah, you mean, I could define the logger.dir somewhere on the command
> line, for example in  the bin/startup.bat file, where I currently have
>
> set JAVA_OPTS="-Xms64000k -Xmx512000k -Djetty.port=%JETTY_PORT%
> -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"
>
> I could just add another -Dlogger.dir=.... ?  I'll try that and report
> back.  Thanks.

Hmm, no this doesn't work.  But it was worth a try.

--
cheers,
Jakob.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: customising location of log files

Pierrick Brihaye-2
Hi,

Jakob Fix wrote:

>> set JAVA_OPTS="-Xms64000k -Xmx512000k -Djetty.port=%JETTY_PORT%
>> -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"
>>
>> I could just add another -Dlogger.dir=.... ?  I'll try that and report
>> back.  Thanks.
>
> Hmm, no this doesn't work.  But it was worth a try.

This logger.dir system variable is overwritten in
org.exist.http.servlets.Log4jInit.java, line 67
(http://cvs.sourceforge.net/viewcvs.py/exist/eXist-1.0/src/org/exist/http/servlets/Log4jInit.java?annotate=1.4)


A more generic implementation may be as simple as testing if this system
property is already set or not... and to consider File(existDir,
"WEB-INF/logs") as the logs directory if it is not.

Cheers,

--
Pierrick Brihaye, informaticien
Service régional de l'Inventaire
DRAC Bretagne
mailto:[hidden email]
+33 (0)2 99 29 67 78
http://usenet-fr.news.eu.org/fr-chartes/rfc1855.html. L'avez-vous lu ?


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: customising location of log files

Jakob Fix-2
In reply to this post by Jakob Fix-2
On 24/10/05, Dannes Wessels <[hidden email]> wrote:
> yes, but only if you deploy exist as a war file,.......

Ah, which I do not.  Ok.  This whole logging business gets more and
more complicated.  I've Jetty, Cocoon and Exist all needing/wanting to
log, each one using their own logging mechanism, with their own config
files ...

Thanks.

> On 10/24/05, Jakob Fix <[hidden email]> wrote:
> > Hi Dannes,
> >
> > On 24/10/05, Dannes Wessels <[hidden email]> wrote:
> > > small note:
> > >
> > > Log4jInit.java is only executed in a servlet environment.............
> >
> > That would be my case, as I run it inside the Cocoon that's delivered
> > with Exist, correct?

--
cheers,
Jakob.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open