You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by EP...@upstate.com on 2003/06/10 15:27:01 UTC
Correct path name for logging in 2.3?
Hi all,
I know this has been asked, but I haven't been able to find it in the
lists.. I promise to add it to the wiki!
For log4j, I load my properties, but I keep getting:
ConfigServlet::initLogging - log4j configuration str =
[C:\fortius\target\fortius\/WEB-INF/conf/log4j.properties]
log4j:ERROR setFile(null,false) call failed.
java.io.FileNotFoundException: \logs\turbine.log (The system cannot find the
path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
at
org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123
)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
at
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.jav
a:645)
My relevant portion is:
#out to file
log4j.appender.application = org.apache.log4j.FileAppender
log4j.appender.application.file =${applicationRoot}/logs/turbine.log
log4j.appender.application.layout = org.apache.log4j.PatternLayout
log4j.appender.application.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.application.append = false
I have tried file=/logs/turbine.log and logs/turbine.log etc... Any
suggestions?
Eric Pugh
Re: Correct path name for logging in 2.3?
Posted by Rodrigo Reyes <ro...@instaservi.com>.
Mmmm... I had the same problem with ver 2.2 and I had to use abolute paths.
Try that, although I know it isn't the best solution... I haven't been able
to use relative paths so far...
Rodrigo
----- Original Message -----
From: <EP...@upstate.com>
To: <tu...@jakarta.apache.org>
Sent: Tuesday, June 10, 2003 8:27 AM
Subject: Correct path name for logging in 2.3?
> Hi all,
>
> I know this has been asked, but I haven't been able to find it in the
> lists.. I promise to add it to the wiki!
>
> For log4j, I load my properties, but I keep getting:
> ConfigServlet::initLogging - log4j configuration str =
> [C:\fortius\target\fortius\/WEB-INF/conf/log4j.properties]
> log4j:ERROR setFile(null,false) call failed.
> java.io.FileNotFoundException: \logs\turbine.log (The system cannot find
the
> path specified)
> at java.io.FileOutputStream.open(Native Method)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
> at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
> at
> org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
> at
> org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
> at
>
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123
> )
> at
>
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
> at
>
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.jav
> a:645)
>
> My relevant portion is:
> #out to file
> log4j.appender.application = org.apache.log4j.FileAppender
> log4j.appender.application.file =${applicationRoot}/logs/turbine.log
> log4j.appender.application.layout = org.apache.log4j.PatternLayout
> log4j.appender.application.layout.conversionPattern = %d [%t] %-5p %c -
%m%n
> log4j.appender.application.append = false
>
>
> I have tried file=/logs/turbine.log and logs/turbine.log etc... Any
> suggestions?
>
> Eric Pugh
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: Correct path name for logging in 2.3?
Posted by Akshay Kapur <ak...@cisco.com>.
A question on the same subject -
Our environment allows log files to be written to only one given log file.
The path is /opt/httpd/logs/app/myapp/tomcat.log
When I try to set this path as below ...
log4j.appender.turbine.file = /opt/httpd/logs/app/myapp/tomcat.log
... a FileNotFound exception is thrown.
When I remove the entire path and simply give say tomcat.log, the log file
is created.
My problem is that I HAVE to point all logs - from tomcat, turbine,
velocity, torque - to /opt/httpd/logs/app/myapp/tomcat.log
Regards
Akshay
At 09:05 PM 6/11/2003 +0000, Henning P. Schmiedehausen wrote:
>EPugh@upstate.com writes:
>
> >------_=_NextPart_001_01C32F53.F9C69D00
> >Content-Type: text/plain;
> > charset="iso-8859-1"
>
>Hi,
>
>this is Java, so you might end up forward slashes even under
>Windows. I haven't tried that yet but I will have to deploy on Windows
>pretty soon so I will get some more information on that.
>
>This works:
>
>web.xml:
>
><servlet>
> <servlet-name>demoapp</servlet-name>
> <servlet-class>org.apache.turbine.Turbine</servlet-class>
> <init-param>
> <param-name>properties</param-name>
> <param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
> </init-param>
></servlet>
>
>TurbineResources.properties:
>
>log4j.file = /WEB-INF/conf/Log4j.properties
>
>Log4j.properties:
>
>log4j.appender.turbine = org.apache.log4j.FileAppender
>log4j.appender.turbine.file = ${applicationRoot}/logs/turbine.log
>log4j.appender.turbine.layout = org.apache.log4j.PatternLayout
>log4j.appender.turbine.layout.conversionPattern = %d [%t] %-5p %c - %m%n
>log4j.appender.turbine.append = false
>
>I use this all the time and it never gave me any trouble. Running with
>JDK 1.3.1 and 1.4.1 under RedHat Linux 7.3
>
>I will add "Testing under Windows 2k" for my list of things to do
>before we push 2.3 out of the door.
>
>But this above _should_ work without changes (even without changing the
>"/" to "\" on Windows 2k). This is how the Java platform is defined.
>
> Regards
> Henning
>--
>Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
>hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
>
>Java, perl, Solaris, Linux, xSP Consulting, Web Services
>freelance consultant -- Jakarta Turbine Development -- hero for hire
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: Correct path name for logging in 2.3?
Posted by Akmal Sarhan <as...@byteaction.de>.
I have the same problem with Turbine 2.2
the thing is that when Log4j encounters a path that has a "${", it tries to
look for it in the Sysetem properties, if that fails it tries to load it
from the properties file, but guess which one? : log4j.properties and since
${ApplicationRoot} is written on Turbine start up to TR.properties, log4j
returns simply an empty String.
regards
Akmal
----- Original Message -----
From: "Quinton McCombs" <qm...@nequalsone.com>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>;
<hp...@intermeta.de>
Sent: Wednesday, June 11, 2003 11:09 PM
Subject: RE: Correct path name for logging in 2.3?
> This also works fine for me. I use it on WinXP and Linux.
>
> --------------------------------------------
> Quinton McCombs
> NequalsOne - HealthCare marketing tools
> mailto:qmccombs@NequalsOne.com
> http://www.NequalsOne.com
>
> > -----Original Message-----
> > From: Henning P. Schmiedehausen [mailto:hps@intermeta.de]
> > Sent: Wednesday, June 11, 2003 4:06 PM
> > To: turbine-user@jakarta.apache.org
> > Subject: Re: Correct path name for logging in 2.3?
> >
> >
> > EPugh@upstate.com writes:
> >
> > >------_=_NextPart_001_01C32F53.F9C69D00
> > >Content-Type: text/plain;
> > > charset="iso-8859-1"
> >
> > Hi,
> >
> > this is Java, so you might end up forward slashes even under
> > Windows. I haven't tried that yet but I will have to deploy
> > on Windows pretty soon so I will get some more information on that.
> >
> > This works:
> >
> > web.xml:
> >
> > <servlet>
> > <servlet-name>demoapp</servlet-name>
> > <servlet-class>org.apache.turbine.Turbine</servlet-class>
> > <init-param>
> > <param-name>properties</param-name>
> >
> > <param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
> > </init-param>
> > </servlet>
> >
> > TurbineResources.properties:
> >
> > log4j.file = /WEB-INF/conf/Log4j.properties
> >
> > Log4j.properties:
> >
> > log4j.appender.turbine = org.apache.log4j.FileAppender
> > log4j.appender.turbine.file = ${applicationRoot}/logs/turbine.log
> > log4j.appender.turbine.layout =
> > org.apache.log4j.PatternLayout
> > log4j.appender.turbine.layout.conversionPattern = %d [%t]
> > %-5p %c - %m%n log4j.appender.turbine.append = false
> >
> > I use this all the time and it never gave me any trouble.
> > Running with JDK 1.3.1 and 1.4.1 under RedHat Linux 7.3
> >
> > I will add "Testing under Windows 2k" for my list of things
> > to do before we push 2.3 out of the door.
> >
> > But this above _should_ work without changes (even without
> > changing the "/" to "\" on Windows 2k). This is how the Java
> > platform is defined.
> >
> > Regards
> > Henning
> > --
> > Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
> > hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
> >
> > Java, perl, Solaris, Linux, xSP Consulting, Web Services
> > freelance consultant -- Jakarta Turbine Development -- hero for hire
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
RE: Correct path name for logging in 2.3?
Posted by Quinton McCombs <qm...@nequalsone.com>.
This also works fine for me. I use it on WinXP and Linux.
--------------------------------------------
Quinton McCombs
NequalsOne - HealthCare marketing tools
mailto:qmccombs@NequalsOne.com
http://www.NequalsOne.com
> -----Original Message-----
> From: Henning P. Schmiedehausen [mailto:hps@intermeta.de]
> Sent: Wednesday, June 11, 2003 4:06 PM
> To: turbine-user@jakarta.apache.org
> Subject: Re: Correct path name for logging in 2.3?
>
>
> EPugh@upstate.com writes:
>
> >------_=_NextPart_001_01C32F53.F9C69D00
> >Content-Type: text/plain;
> > charset="iso-8859-1"
>
> Hi,
>
> this is Java, so you might end up forward slashes even under
> Windows. I haven't tried that yet but I will have to deploy
> on Windows pretty soon so I will get some more information on that.
>
> This works:
>
> web.xml:
>
> <servlet>
> <servlet-name>demoapp</servlet-name>
> <servlet-class>org.apache.turbine.Turbine</servlet-class>
> <init-param>
> <param-name>properties</param-name>
>
> <param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
> </init-param>
> </servlet>
>
> TurbineResources.properties:
>
> log4j.file = /WEB-INF/conf/Log4j.properties
>
> Log4j.properties:
>
> log4j.appender.turbine = org.apache.log4j.FileAppender
> log4j.appender.turbine.file = ${applicationRoot}/logs/turbine.log
> log4j.appender.turbine.layout =
> org.apache.log4j.PatternLayout
> log4j.appender.turbine.layout.conversionPattern = %d [%t]
> %-5p %c - %m%n log4j.appender.turbine.append = false
>
> I use this all the time and it never gave me any trouble.
> Running with JDK 1.3.1 and 1.4.1 under RedHat Linux 7.3
>
> I will add "Testing under Windows 2k" for my list of things
> to do before we push 2.3 out of the door.
>
> But this above _should_ work without changes (even without
> changing the "/" to "\" on Windows 2k). This is how the Java
> platform is defined.
>
> Regards
> Henning
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
> hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
>
> Java, perl, Solaris, Linux, xSP Consulting, Web Services
> freelance consultant -- Jakarta Turbine Development -- hero for hire
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: Correct path name for logging in 2.3?
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
EPugh@upstate.com writes:
>------_=_NextPart_001_01C32F53.F9C69D00
>Content-Type: text/plain;
> charset="iso-8859-1"
Hi,
this is Java, so you might end up forward slashes even under
Windows. I haven't tried that yet but I will have to deploy on Windows
pretty soon so I will get some more information on that.
This works:
web.xml:
<servlet>
<servlet-name>demoapp</servlet-name>
<servlet-class>org.apache.turbine.Turbine</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
</init-param>
</servlet>
TurbineResources.properties:
log4j.file = /WEB-INF/conf/Log4j.properties
Log4j.properties:
log4j.appender.turbine = org.apache.log4j.FileAppender
log4j.appender.turbine.file = ${applicationRoot}/logs/turbine.log
log4j.appender.turbine.layout = org.apache.log4j.PatternLayout
log4j.appender.turbine.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.turbine.append = false
I use this all the time and it never gave me any trouble. Running with
JDK 1.3.1 and 1.4.1 under RedHat Linux 7.3
I will add "Testing under Windows 2k" for my list of things to do
before we push 2.3 out of the door.
But this above _should_ work without changes (even without changing the
"/" to "\" on Windows 2k). This is how the Java platform is defined.
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
Java, perl, Solaris, Linux, xSP Consulting, Web Services
freelance consultant -- Jakarta Turbine Development -- hero for hire
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
RE: Correct path name for logging in 2.3?
Posted by Chris K Chew <ch...@fenetics.com>.
> From: EPugh@upstate.com [mailto:EPugh@upstate.com]
>
> For log4j, I load my properties, but I keep getting:
> ConfigServlet::initLogging - log4j configuration str =
> [C:\fortius\target\fortius\/WEB-INF/conf/log4j.properties]
> log4j:ERROR setFile(null,false) call failed.
> java.io.FileNotFoundException: \logs\turbine.log (The system
> cannot find the
> path specified)
My log4j file looks just like yours, and it works, so I am thinking the
problem is somewhere else. The "\/" looks suspicious to me. Is
"C:\fortius\target\fortius\" (with the trailing \) set in server.xml,
web.xml, or your path for a temporary context installation? If so, what
happens if you remove the trailing "\"?
Ck
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
RE: Correct path name for logging in 2.3?
Posted by Quinton McCombs <qm...@nequalsone.com>.
Is then when running inside the servlet container? If so, which
container are you using? What is in your web.xml?
--------------------------------------------
Quinton McCombs
NequalsOne - HealthCare marketing tools
mailto:qmccombs@NequalsOne.com
http://www.NequalsOne.com
> -----Original Message-----
> From: EPugh@upstate.com [mailto:EPugh@upstate.com]
> Sent: Tuesday, June 10, 2003 8:27 AM
> To: turbine-user@jakarta.apache.org
> Subject: Correct path name for logging in 2.3?
>
>
> Hi all,
>
> I know this has been asked, but I haven't been able to find it in the
> lists.. I promise to add it to the wiki!
>
> For log4j, I load my properties, but I keep getting:
> ConfigServlet::initLogging - log4j configuration str =
> [C:\fortius\target\fortius\/WEB-INF/conf/log4j.properties]
> log4j:ERROR setFile(null,false) call failed.
> java.io.FileNotFoundException: \logs\turbine.log (The system
> cannot find the
> path specified)
> at java.io.FileOutputStream.open(Native Method)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
> at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
> at
> org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
> at
> org.apache.log4j.config.PropertySetter.activate(PropertySetter
> .java:247)
> at
> org.apache.log4j.config.PropertySetter.setProperties(PropertyS
> etter.java:123
> )
> at
> org.apache.log4j.config.PropertySetter.setProperties(PropertyS
> etter.java:87)
> at
> org.apache.log4j.PropertyConfigurator.parseAppender(PropertyCo
> nfigurator.jav
> a:645)
>
> My relevant portion is:
> #out to file
> log4j.appender.application = org.apache.log4j.FileAppender
> log4j.appender.application.file =${applicationRoot}/logs/turbine.log
> log4j.appender.application.layout = org.apache.log4j.PatternLayout
> log4j.appender.application.layout.conversionPattern = %d [%t]
> %-5p %c - %m%n
> log4j.appender.application.append = false
>
>
> I have tried file=/logs/turbine.log and logs/turbine.log etc... Any
> suggestions?
>
> Eric Pugh
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org