[jira] Commented: (PNIX-3) Log4j log file defined in enviornment.xml is created in working directory

[email protected] Wed, 19 Mar 2003 23:33:10 -0600 (CST)
Newsgroups gmane.comp.jakarta.avalon.phoenix.devel,gmane.comp.jakarta.turbine.maven.devel
Message-ID <3511628.1048138390533.JavaMail.bob__27592.4693247818$1048133867@eng.werken.com>
The following comment has been added to this issue:

     Author: Peter Donald
    Created: Wed, 19 Mar 2003 11:31 PM
       Body:
Theres no way to safely set the working directory in a JVM. There may be JVM specific hacks (like setting user.dir system property) but they can be dangerous and unpreductable (especially when things like classpath are defined relative to working directory).

I think the best way to "solve" this problem is to preprocess the xml and just replace variables in any attribute in same way that we replace variables in policy xml. 

For the moment we can do it as an ugly hack but in the next version I would like to see all of our configuration files potentially process via jelly and jelly could resolve all variables like ${phoenix.home}, ${app.home} etc.
---------------------------------------------------------------------
View the issue:

  http://jira.codehaus.org/secure/ViewIssue.jspa?key=PNIX-3


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: PNIX-3
    Summary: Log4j log file defined in enviornment.xml is created in working directory
       Type: Bug

     Status: Assigned
   Priority: Minor

 Time Spent: Unknown
   Estimate: 0 minutes

    Project: phoenix
 Components: 
             Log Manager
   Fix Fors:
             4.1
   Versions:
             4.1

   Assignee: peter royal
   Reporter: 

    Created: Mon, 17 Mar 2003 6:33 PM
    Updated: Wed, 19 Mar 2003 10:19 PM
Environment: Phoneix 4.1, linux X86, JDK 1.4.1, Ant 1.5.1

Description:

When configuring log4j loging for a phoenix application, defining the location of the log file "foo.txt" below, results in this log file being created in   working directory from which phonix was launched from rather than inside the deployed directory hierarchy of the SAR application it self.

This log file if defined by the SAR application, should reside inside the SAR/foo.txt  instead of say PHOENIX_HOME/bin/foo.txt if that happens to be where run.sh is launched from.

please consult mail thread:http://www.mail-archive.com/users%40avalon.apache.org/msg00407.html

example of enviornment.xml configuration used for this.

      <logs version="log4j">
        <appender name="FILE" class="org.apache.log4j.FileAppender">
           <param name="File" value="foo.txt"/>
           <param name="Append" value="false"/>
           <layout class="org.apache.log4j.PatternLayout">
              <param name="ConversionPattern" value="%p - korosh - %m%n"/>
           </layout>
        </appender>
        <root>
           <priority value="debug"/>
           <appender-ref ref="FILE"/>
        </root>
      </logs>


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira