
|
If you were logged in you would be able to see more operations.
|
|
|
logback-core
Created: 31/Oct/08 09:07 AM
Updated: 03/Feb/09 05:59 PM
|
|
| Component/s: |
Appender,
Joran
|
| Affects Version/s: |
0.9.11
|
| Fix Version/s: |
None
|
|
|
Environment:
|
Ubuntu 8.04, J2SE 6
|
|
|
Following discussion on the mailing list, it would be very convenient to be able to use patterns in the filename of a FileAppender. My initial expectation was to be able to do something like:
<appender name="myFileAppender" class="ch.qos.logback.core.FileAppender">
<file>${logFolder}/SomePrefix.%d.someExt</file>
[...]
</appender>
where %d would be substituted by the current date. However Ralph Goers, when replying to my question on the mailing list, suggested a more flexibl approach:
<appender name="myFileAppender" class="ch.qos.logback.core.FileAppender">
<File resolver="com.mycorp.logback.MyPatternResolver">someName.%{host}.%{datetime}.log</File>
[...]
</appender>
with MyPatternResolver implementing an interface like:
package ch.qos.logback.core.pattern;
public interface Resolver {
String resolve(String pattern);
}
Providing a default implementation allowing to generate timestamp, use system properties, would be nice too.
Currently this can be done programmatically, but it would be most convenient to have the possibility to do this using the Joran configurator.
Best regards,
Nicolas
|
|
Description
|
Following discussion on the mailing list, it would be very convenient to be able to use patterns in the filename of a FileAppender. My initial expectation was to be able to do something like:
<appender name="myFileAppender" class="ch.qos.logback.core.FileAppender">
<file>${logFolder}/SomePrefix.%d.someExt</file>
[...]
</appender>
where %d would be substituted by the current date. However Ralph Goers, when replying to my question on the mailing list, suggested a more flexibl approach:
<appender name="myFileAppender" class="ch.qos.logback.core.FileAppender">
<File resolver="com.mycorp.logback.MyPatternResolver">someName.%{host}.%{datetime}.log</File>
[...]
</appender>
with MyPatternResolver implementing an interface like:
package ch.qos.logback.core.pattern;
public interface Resolver {
String resolve(String pattern);
}
Providing a default implementation allowing to generate timestamp, use system properties, would be nice too.
Currently this can be done programmatically, but it would be most convenient to have the possibility to do this using the Joran configurator.
Best regards,
Nicolas
|
Show » |
|
My suggestion would be that any pattern allowed in the filepattern (e.g. addition of a timezone) should be allowed in the initial filename.
Thanks,
Neil