[ 
https://issues.apache.org/jira/browse/LOG4J2-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma updated LOG4J2-412:
-------------------------------

    Description: 
Using sample config for RollingRandomAccessFile, with log name retrieved from 
enviroment variable "Fubar"...
{code}
    <RollingRandomAccessFile name="RollingRandomAccessFile" 
        fileName="logs/${sys:Fubar}.log"
        
filePattern="logs/$${date:yyyy-MM-dd}/${sys:Fubar}-%d{MM-dd-yyyy}-%i.log.gz">
{code}
Along with a harness program,
{code}
    public static void main(String[] args) {
        for (int i=0; i < 100000; i++) {
            logger.info("Logger writes message for the nth time " + i);
        }
        System.out.println("Done");
    }
{code}
If I use $\{sys:Fubar}, instead of, say a literal value, the contents of the 
first rolled file are lost. I had SizeBasedTriggeringPolicy set to 1 MB, 
meaning, 21296 log messages were lost.

  was:
Using sample config for RollingRandomAccessFile, with log name retrieved from 
enviroment variable "Fubar"...
    <RollingRandomAccessFile name="RollingRandomAccessFile" 
        fileName="logs/${sys:Fubar}.log"
        
filePattern="logs/$${date:yyyy-MM-dd}/${sys:Fubar}-%d{MM-dd-yyyy}-%i.log.gz">

Along with a harness program,
    public static void main(String[] args) {
        for (int i=0; i < 100000; i++) {
            logger.info("Logger writes message for the nth time " + i);
        }
        System.out.println("Done");
    }

If I use ${sys:Fubar}, instead of, say a literal value, the contents of the 
first rolled file are lost. I had SizeBasedTriggeringPolicy set to 1 MB, 
meaning, 21296 log messages were lost.


> RollingRandomAccessFile appender loses output when fileName/filePattern 
> accesses ${sys:property}
> ------------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-412
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-412
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta9
>         Environment: Windows 7, JDK 1.7.25
>            Reporter: bryan headley
>
> Using sample config for RollingRandomAccessFile, with log name retrieved from 
> enviroment variable "Fubar"...
> {code}
>     <RollingRandomAccessFile name="RollingRandomAccessFile" 
>         fileName="logs/${sys:Fubar}.log"
>         
> filePattern="logs/$${date:yyyy-MM-dd}/${sys:Fubar}-%d{MM-dd-yyyy}-%i.log.gz">
> {code}
> Along with a harness program,
> {code}
>     public static void main(String[] args) {
>         for (int i=0; i < 100000; i++) {
>             logger.info("Logger writes message for the nth time " + i);
>         }
>         System.out.println("Done");
>     }
> {code}
> If I use $\{sys:Fubar}, instead of, say a literal value, the contents of the 
> first rolled file are lost. I had SizeBasedTriggeringPolicy set to 1 MB, 
> meaning, 21296 log messages were lost.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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

Reply via email to