5 Jun 2008 09:04
Re: [RELATIVE PATHS] Experiencing problems: relative paths are not recognized
Jon Haitz Legarreta Gorroño <jhlegarreta <at> vicomtech.org>
2008-06-05 07:04:42 GMT
2008-06-05 07:04:42 GMT
Hi Jake,
thanks for your suggestion, but I am not saying that
log4j.appender.Appender.File=${logDir}/ADMPAC.log
does not work, I am saying that logDir is always empty .To verify
whether the way I define it is the correct one, please refer to point 1
to my first post.
Thanks for any help,
JON HAITZ
Jacob Kjome escribió:
> On Tue, 03 Jun 2008 09:57:07 +0200
> Jon Haitz Legarreta Gorroño <jhlegarreta <at> vicomtech.org> wrote:
>> Hi again,
>> thanks for your answer Curt, but it did not fix the problem. I'm
>> still experiencing the same problems as yesterday.
>>
>> Any other ideas?
>
> You are saying that the following doesn't work for you?
>
> log4j.appender.Appender.File=${logDir}/ADMPAC.log
>
> That would be really surprising as I use this all the time and it has
> never failed for me.
>
> Jake
>
>>
>> Thank you,
>> JON HAITZ
>>
>>
>>
>> Curt Arnold escribió:
>>>
>>> On Jun 2, 2008, at 6:01 AM, Jon Haitz Legarreta Gorroño wrote:
>>>
>>>> Hi there,
>>>> I'm experiencing many problems with the log file path while trying
>>>> to use a relative file path. I've got a Web application written in
>>>> Java and powered by Tomcat. The thing is I'm doing my development
>>>> in a Windows machine and so far I've hard-coded the path I want my
>>>> log file to be written. But the application is intended to be
>>>> deployed in a Linux machine and therefore the log file path is
>>>> bound to change.
>>>> So far, I'm writing both paths in my log4j.properties file and
>>>> commenting the one I don't need in each situation:
>>>>
>>>>
log4j.appender.Appender.File=C:\\emedica\\SEG_QUIM\\aplicacion\\filesystem\\securequim\\logs\\ADMPAC\\ADMPAC.log
>>>>
>>>> #log4j.appender.Appender.File=/home/securequim/logs/ADMPAC/ADMPAC.log
>>>>
>>>> Now, this is not very practical and I think it could be improved.
>>>> The way to improve it, I guess, is by specifying a variable to be
>>>> used in the log4j.properties file, the same as ${cataline.home} or
>>>> ${user.home}. Now what I do is the following:
>>>>
>>>> 1. I right-click in the Apache Tomcat icon in the notification area
>>>> of Windows and choose "Configure...". I then go to the "Java" tab
>>>> and in the "Java Options", which already contains the following:
>>>>
>>>> -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.0
>>>> -Djava.endorsed.dirs=C:\Program Files\Apache Software
>>>> Foundation\Tomcat 5.0\common\endorsed
>>>> -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat
>>>> 5.0
>>>>
>>>> I add:
>>>>
>>>> -DlogDir=C:\emedica\SEG_QUIM\aplicacion\filesystem\securequim\logs\ADMPAC
>>>>
>>>>
>>>> in my Windows machine.
>>>>
>>>> 2. In my log4j.properties file I substitute the absolute hard-coded
>>>> path with the following line:
>>>>
>>>> log4j.appender.Appender.File=${logDir}\\ADMPAC.log
>>>>
>>>> 3. Much to my surprise, my log file is written in my root directory
>>>> (C:\) !!!
>>>> I've been debugging the application and it seems as though either
>>>> Tomcat or the JVM (I don't know which of the does the operation) do
>>>> not recognise the logDir variable: the fileName variable contains a
>>>> bacsklash.
>>>>
>>>> 4. Even more surprising: the same happens when I use
>>>> ${catalina.home} !!!
>>>>
>>>>
>>>> I've been reading lots of Web pages on this, but apparently none
>>>> was the right one... Any help would be highly appreciated.
>>>>
>>>> Thanks,
>>>> JON HAITZ
>>>>
>>>
>>> Could you try again, but using forward slashes instead of back
>>> slashes. log4j configuration has some unexpected treatment of
>>> backslashes, but changing them could result in configurations that
>>> depended on the old interpretation no longer working. However,
>>> forward slashes do not have that issue and the Java run-time will
>>> translate them to back slashes before calling Win32 API methods.
>>>
>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=22894
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
>>> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>>>
>>>
>>
>> --
>>
>> Jon Haitz Legarreta Gorroño
>> Laguntzaile zientifikoa / Colaborador científico / Scientific
>> collaborator
>>
>> VICOMTech - Visual Interaction and Communication Technologies Center
>> Mikeletegi Pasealekua, 57 - Parque Tecnológico
>> E-20009 Donostia - San Sebastián, Spain
>> Tel: +[34] 943 30 92 30
>> Fax: +[34] 943 30 93 93
>> e-mail: jhlegarreta <at> vicomtech.org
>> http://www.vicomtech.org
>>
>> *** member of INI-GraphicsNet ****
>> http://www.inigraphics.net
>> *** member of IK4 Research Alliance ****
>> http://www.ik4.es
>>
>> -----------------------------------------------------
>> VICOMTech is an ISO 9001:2000 certified institute
>> -----------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
>> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>
>
--
Jon Haitz Legarreta Gorroño
Laguntzaile zientifikoa / Colaborador científico / Scientific collaborator
VICOMTech - Visual Interaction and Communication Technologies Center
Mikeletegi Pasealekua, 57 - Parque Tecnológico
E-20009 Donostia - San Sebastián, Spain
Tel: +[34] 943 30 92 30
Fax: +[34] 943 30 93 93
e-mail: jhlegarreta <at> vicomtech.org
http://www.vicomtech.org
*** member of INI-GraphicsNet ****
http://www.inigraphics.net
*** member of IK4 Research Alliance ****
http://www.ik4.es
-----------------------------------------------------
VICOMTech is an ISO 9001:2000 certified institute
-----------------------------------------------------
RSS Feed