resend. logback include file can not be found

Hi: I put an include directive in my logback.xml <configuration> <include file="includedConfig.xml" /> </configuration> the "includedConfig.xml" is in the same directory (classpath) as the logback.xml file itself. But logback runtime keeps saying [java] 03:21:41,533 |-ERROR in ch.qos.logback.core.joran.action.IncludeAction - File [includedConfig.xml] does not exist. java.io.FileNotFoundException: logback.xml (The system cannot find the file specified) Using a absolute path is not a choice here so I wonder what would be the best way to do this or maybe I misunderstand something. I'd assume logback program would know the location of logback.xml so it would use it as the reference point to figure out any relative path. Thanks -Ted

Hello Ted, Could you please file a bug report with a test case? TIA, On 25/03/2010 6:18 PM, Ted Meng wrote:
Hi:
I put an include directive in my logback.xml
<configuration> <include file="includedConfig.xml" /> </configuration>
the "includedConfig.xml" is in the same directory (classpath) as the logback.xml file itself. But logback runtime keeps saying [java] 03:21:41,533 |-ERROR in ch.qos.logback.core.joran.action.IncludeAction - File [includedConfig.xml] does not exist. java.io.FileNotFoundException: logback.xml (The system cannot find the file specified) Using a absolute path is not a choice here so I wonder what would be the best way to do this or maybe I misunderstand something. I'd assume logback program would know the location of logback.xml so it would use it as the reference point to figure out any relative path.
Thanks
-Ted

If you wish to reference a resource on the class path, use the "resource" attribute. Example: <configuration> <include resource="includedConfig.xml"/> </configuration> This is already explained in the docs but not very explicitly. On 25/03/2010 6:18 PM, Ted Meng wrote:
Hi:
I put an include directive in my logback.xml
<configuration> <include file="includedConfig.xml" /> </configuration>
the "includedConfig.xml" is in the same directory (classpath) as the logback.xml file itself. But logback runtime keeps saying [java] 03:21:41,533 |-ERROR in ch.qos.logback.core.joran.action.IncludeAction - File [includedConfig.xml] does not exist. java.io.FileNotFoundException: logback.xml (The system cannot find the file specified) Using a absolute path is not a choice here so I wonder what would be the best way to do this or maybe I misunderstand something. I'd assume logback program would know the location of logback.xml so it would use it as the reference point to figure out any relative path.
Thanks
-Ted

Thanks. it works using resource. I will file a bug report for file type Ceki Gülcü wrote:
If you wish to reference a resource on the class path, use the "resource" attribute. Example:
<configuration> <include resource="includedConfig.xml"/> </configuration>
This is already explained in the docs but not very explicitly.
On 25/03/2010 6:18 PM, Ted Meng wrote:
Hi:
I put an include directive in my logback.xml
<configuration> <include file="includedConfig.xml" /> </configuration>
the "includedConfig.xml" is in the same directory (classpath) as the logback.xml file itself. But logback runtime keeps saying [java] 03:21:41,533 |-ERROR in ch.qos.logback.core.joran.action.IncludeAction - File [includedConfig.xml] does not exist. java.io.FileNotFoundException: logback.xml (The system cannot find the file specified) Using a absolute path is not a choice here so I wonder what would be the best way to do this or maybe I misunderstand something. I'd assume logback program would know the location of logback.xml so it would use it as the reference point to figure out any relative path.
Thanks
-Ted
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Ted, No need to file a bug report. The documentation is not clear on the subject but the file attribute works correctly. The docs will be updated so that the confusion does not arise in the future. On 26/03/2010 4:10 PM, Ted Meng wrote:
Thanks. it works using resource. I will file a bug report for file type
Ceki Gülcü wrote:
If you wish to reference a resource on the class path, use the "resource" attribute. Example:
<configuration> <include resource="includedConfig.xml"/> </configuration>

Hello Ceki, I have updated patch for http://jira.qos.ch/browse/LBCLASSIC-182 and sent the signed CLA to your email. Please inform me, when you'll catch it. Best regards, Aleksey Didik.

Hello Aleksey, Got the CLA. Thank you. LBCLASSIC-182 is on my todo list. On 26/03/2010 4:25 PM, Aleksey Didik wrote:
Hello Ceki, I have updated patch for http://jira.qos.ch/browse/LBCLASSIC-182 and sent the signed CLA to your email.
Please inform me, when you'll catch it.
Best regards, Aleksey Didik.

I switched back from resource to "file" and it failed again. So as of version 0.9.18, it appears the the file type requires absolute path, which works. but not for relative path, such as current logback.xml directory. Ceki Gülcü wrote:
Ted,
No need to file a bug report. The documentation is not clear on the subject but the file attribute works correctly. The docs will be updated so that the confusion does not arise in the future.
On 26/03/2010 4:10 PM, Ted Meng wrote:
Thanks. it works using resource. I will file a bug report for file type
Ceki Gülcü wrote:
If you wish to reference a resource on the class path, use the "resource" attribute. Example:
<configuration> <include resource="includedConfig.xml"/> </configuration>
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
participants (3)
-
Aleksey Didik
-
Ceki Gülcü
-
Ted Meng