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

prayagupd updated LOG4J2-1767:
------------------------------
    Description: 

I have log4j2.json config as below, with SizeBasedTriggeringPolicy as 1MB. Its 
a web app hosted on tomcat 7.

{code}
{
  "configuration": {
    "status" : "info",
    "shutdownHook":"disable",
    "name": "logggg",
    "appenders": {
      "RollingFile": {
        "name": "rollingFile",
        "fileName": "/var/log/cor/test_logging12.log",
        "filePattern": 
"/var/log/cor/test_logging12-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz",
        "CustomJSONLayout": {
          "complete": false,
          "compact": true,
          "eventEol": true
        },
        "SizeBasedTriggeringPolicy": {
          "size": "1 MB"
        },
        "DefaultRolloverStrategy": {
          "max": "10"
        }
      }
    },
    "loggers": {
      "root": {
        "level": "DEBUG",
        "appender-ref": {
          "ref": "rollingFile"
        }
      }
    }
  }
}
{code}

When I changed that in on the fly, it is taken in account by  log4j2, it still 
rolls over on the older size. It reads the new size only if I restart the 
server.

{code}
2017-01-05 12:44:22,143 http-bio-8989-exec-10 TRACE 
DefaultRolloverStrategy.purge() took 0.0 milliseconds
2017-01-05 12:44:22,144 http-bio-8989-exec-10 DEBUG RollingFileManager 
executing synchronous FileRenameAction[/var/log/cor/logging12.log to 
/var/log/cor/logging12-01-05-17-12-44-22-1.log, renameEmptyFiles=false]
2017-01-05 12:44:22,144 http-bio-8989-exec-10 DEBUG RollingFileManager 
executing async GzCompressAction[/var/log/cor/logging12-01-05-17-12-44-22-1.log 
to /var/log/cor/logging12-01-05-17-12-44-22-1.log.gz, deleteSource=true]
{code}


> when SizeBasedTriggeringPolicy value is changed, log4j2 still picks up the 
> older value
> --------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1767
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1767
>             Project: Log4j 2
>          Issue Type: Question
>          Components: Appenders
>    Affects Versions: 2.5
>         Environment: IBM Websphere, 
> java-1.8.0-ibm-1.8.0.3.20-1, 
> IBM Iseries, 
> log4j2 2.5, log4j 2.6.2
>            Reporter: prayagupd
>
> I have log4j2.json config as below, with SizeBasedTriggeringPolicy as 1MB. 
> Its a web app hosted on tomcat 7.
> {code}
> {
>   "configuration": {
>     "status" : "info",
>     "shutdownHook":"disable",
>     "name": "logggg",
>     "appenders": {
>       "RollingFile": {
>         "name": "rollingFile",
>         "fileName": "/var/log/cor/test_logging12.log",
>         "filePattern": 
> "/var/log/cor/test_logging12-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz",
>         "CustomJSONLayout": {
>           "complete": false,
>           "compact": true,
>           "eventEol": true
>         },
>         "SizeBasedTriggeringPolicy": {
>           "size": "1 MB"
>         },
>         "DefaultRolloverStrategy": {
>           "max": "10"
>         }
>       }
>     },
>     "loggers": {
>       "root": {
>         "level": "DEBUG",
>         "appender-ref": {
>           "ref": "rollingFile"
>         }
>       }
>     }
>   }
> }
> {code}
> When I changed that in on the fly, it is taken in account by  log4j2, it 
> still rolls over on the older size. It reads the new size only if I restart 
> the server.
> {code}
> 2017-01-05 12:44:22,143 http-bio-8989-exec-10 TRACE 
> DefaultRolloverStrategy.purge() took 0.0 milliseconds
> 2017-01-05 12:44:22,144 http-bio-8989-exec-10 DEBUG RollingFileManager 
> executing synchronous FileRenameAction[/var/log/cor/logging12.log to 
> /var/log/cor/logging12-01-05-17-12-44-22-1.log, renameEmptyFiles=false]
> 2017-01-05 12:44:22,144 http-bio-8989-exec-10 DEBUG RollingFileManager 
> executing async 
> GzCompressAction[/var/log/cor/logging12-01-05-17-12-44-22-1.log to 
> /var/log/cor/logging12-01-05-17-12-44-22-1.log.gz, deleteSource=true]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
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