You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2005/03/29 02:31:13 UTC

DO NOT REPLY [Bug 34216] New: - [log4j] FileAppender does not create parent dirs

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34216>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34216

           Summary: [log4j] FileAppender does not create parent dirs
           Product: Log4j
           Version: 1.3alpha
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: ggregory@seagullsw.com


FileAppender does not create parent dirs. For example, when the .properties
settings have:

log4j.appender.TextFile.File=log/ais.log

and the current directory "log" does not exists, you get:

2005-03-28 15:36:58,847 [main] ERROR - setFile(/log/ais.log,false) call failed.
java.io.FileNotFoundException: \log\ais.log (The system cannot find the path
specified)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:260)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:149)
	at
org.apache.log4j.PropertyConfigurator.activateOptions(PropertyConfigurator.java:703)
	at
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:692)
	at
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:625)
	at
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:503)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:385)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:321)
	at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:327)
	at
com.seagullsw.appinterface.server.config.Log4jConfiguration.process(Log4jConfiguration.java:75)
	at
com.seagullsw.appinterface.server.config.LogConfiguration.process(LogConfiguration.java:126)
	at
com.seagullsw.appinterface.server.AppInterfaceServer.startInner(AppInterfaceServer.java:1994)
	at
com.seagullsw.appinterface.server.AppInterfaceServer.start(AppInterfaceServer.java:1832)
	at com.seagullsw.appinterface.server.AisHelper.startFromResource(AisHelper.java:79)
	at
com.seagullsw.appinterface.server.AbstractServerTestCase.startServer(AbstractServerTestCase.java:32)
	at
com.seagullsw.appinterface.server.backend.cics.ScgBackEndTestCase.setUpOnce(ScgBackEndTestCase.java:70)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.seagullsw.javax.execution.MessageAction.evaluate(MessageAction.java:66)
	at
com.seagullsw.javax.execution.BasicEvaluableAction.evaluate(BasicEvaluableAction.java:82)
	at com.seagullsw.junitx.OneTimeSetup.evaluate(OneTimeSetup.java:49)
	at com.seagullsw.junitx.OneTimeSetup$1.setUp(OneTimeSetup.java:39)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:23)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
2005-03-28 15:37:33,958 [main] ERROR - No output stream or file set for the
appender named [TextFile].

When I run the unit tests (CVS version) I get:

Minimum:
    [junit] Running org.apache.log4j.MinimumTest
    [junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.129 sec
    [junit] Testsuite: org.apache.log4j.MinimumTest
    [junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.129 sec
    [junit] ------------- Standard Output ---------------
    [junit] *** configurationOptionStr=null
    [junit] ** End of LogManager static initializer
    [junit] ------------- ---------------- ---------------

    [junit] Testcase: simple took 0.089 sec
    [junit]     Caused an ERROR
    [junit] output\simple (Access is denied)
    [junit] java.io.FileNotFoundException: output\simple (Access is denied)
    [junit]     at java.io.FileOutputStream.open(Native Method)
    [junit]     at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    [junit]     at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
    [junit]     at org.apache.log4j.FileAppender.<init>(FileAppender.java:100)
    [junit]     at org.apache.log4j.MinimumTest.simple(MinimumTest.java:63)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [junit] Testcase: ttcc took 0.03 sec
    [junit]     Caused an ERROR
    [junit] output\ttcc (Access is denied)
    [junit] java.io.FileNotFoundException: output\ttcc (Access is denied)
    [junit]     at java.io.FileOutputStream.open(Native Method)
    [junit]     at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    [junit]     at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
    [junit]     at org.apache.log4j.FileAppender.<init>(FileAppender.java:100)
    [junit]     at org.apache.log4j.MinimumTest.ttcc(MinimumTest.java:86)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

I am not sure if this related.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org