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

Mykola Holovach updated LOG4J2-3057:
------------------------------------
    Description: 
My server log4j2 xml configuration below
{code:java}
<Configuration xmlns="http://logging.apache.org/log4j/2.0/config";>  <Appenders>
        <RollingRandomAccessFile name="ERROR_FILE" bufferSize="1024" 
bufferedIO="true" append="true"
                fileName="${LOGS_HOME}/logfinal-error-${HOST_NAME_SHORT}.log"
                
filePattern="${LOGS_HOME}/logfinal-error-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
                <ThresholdFilter level="warn" />
                <PatternLayout pattern="%d{DEFAULT} %-5p %t %c %X{application} 
%x - %m%n" />
            <Policies>
                <TimeBasedTriggeringPolicy interval="1"/>
            </Policies>
        </RollingRandomAccessFile>      <RollingRandomAccessFile 
name="DEBUG_FILE" bufferSize="32768" bufferedIO="true" append="true" 
                fileName="${LOGS_HOME}/logfinal-debug-${HOST_NAME_SHORT}.log"
                
filePattern="${LOGS_HOME}/logfinal-debug-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
                <ThresholdFilter level="debug" />
                <PatternLayout pattern="%d{DEFAULT} %-5p %t %c ${application} 
%x - %m%n" />
            <Policies>
                <TimeBasedTriggeringPolicy interval="1"/>
            </Policies>
        </RollingRandomAccessFile>      <Async name="ASYNC" bufferSize="64">
                <AppenderRef ref="ERROR_FILE" />
                <AppenderRef ref="DEBUG_FILE" />
        </Async>
  </Appenders>  <Loggers>
        <Logger name="ua" level="debug" />
        <Logger name="ua.cetelem.DossierAnalyser" level="info" />
        <Logger name="ua.cetelem.dbaccess.DbAccess" level="info" />
        <Logger name="com.usb" level="debug" />
        <Logger name="jacorb" level="info"/>
        <Logger name="org.owasp" level="trace"/>
    <Root level="info">
      <AppenderRef ref="ASYNC"/>
    </Root>
  </Loggers></Configuration>
{code}
My client side log4j2 xml configuration below
{code:java}
<Configuration xmlns="http://logging.apache.org/log4j/2.0/config";>      
<Appenders>
        <Socket name="logfinal" host="localhost" port="1101">
                <JSONLayout/>
        </Socket>               <RollingFile name="ERROR_FILE"
                        
fileName="build/${sys:LOG4J_APP_NAME:-}-error-${HOST_NAME_SHORT}.log"
                        
filePattern="build/${sys:LOG4J_APP_NAME:-}-error-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
                        <ThresholdFilter level="warn" />
                        <PatternLayout
                                pattern="%d{DEFAULT} %-5p %t %c %x - %m%n" />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1" />
                        </Policies>
                </RollingFile>          <RollingFile name="DEBUG_FILE"
                        
fileName="build/${sys:LOG4J_APP_NAME:-}-debug-${env:NAME_SHORT}.log"
                        
filePattern="build/${sys:LOG4J_APP_NAME:-}-debug-${env:NAME_SHORT}.log.%d{yyyy-MM-dd}">
                        <ThresholdFilter level="debug" />
                        <PatternLayout
                                pattern="%d{DEFAULT} %-5p %t %c %x - %m%n" />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1" />
                        </Policies>
                </RollingFile>
                
                <Async name="ASYNC" bufferSize="64">
                        <AppenderRef ref="ERROR_FILE" />
                        <AppenderRef ref="DEBUG_FILE" />
                        <AppenderRef ref="logfinal" />
                </Async>
        
    </Appenders>        <Loggers>
                <Logger name="org.hibernate.tool.hbm2ddl" level="DEBUG" />
                <Logger name="org.hibernate.SQL" level="INFO" />
                <Logger name="ua.cetelem" level="debug" />
                <Root level="info">
                        <Property name="application">app_name</Property>
                        <AppenderRef ref="ASYNC" />
                </Root>
        </Loggers>
</Configuration>
{code}
I need a help to resolve an issue with high load CPU on the logger server, with 
SocketAppender, what could be the problem and which could be options to resolve 
this problem?

 

  was:
My server log4j2 xml configuration below
{code:java}
<Configuration xmlns="http://logging.apache.org/log4j/2.0/config";>  <Appenders>
        <RollingRandomAccessFile name="ERROR_FILE" bufferSize="1024" 
bufferedIO="true" append="true"
                fileName="${LOGS_HOME}/logfinal-error-${HOST_NAME_SHORT}.log"
                
filePattern="${LOGS_HOME}/logfinal-error-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
                <ThresholdFilter level="warn" />
                <PatternLayout pattern="%d{DEFAULT} %-5p %t %c %X{application} 
%x - %m%n" />
            <Policies>
                <TimeBasedTriggeringPolicy interval="1"/>
            </Policies>
        </RollingRandomAccessFile>      <RollingRandomAccessFile 
name="DEBUG_FILE" bufferSize="32768" bufferedIO="true" append="true" 
                fileName="${LOGS_HOME}/logfinal-debug-${HOST_NAME_SHORT}.log"
                
filePattern="${LOGS_HOME}/logfinal-debug-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
                <ThresholdFilter level="debug" />
                <PatternLayout pattern="%d{DEFAULT} %-5p %t %c ${application} 
%x - %m%n" />
            <Policies>
                <TimeBasedTriggeringPolicy interval="1"/>
            </Policies>
        </RollingRandomAccessFile>      <Async name="ASYNC" bufferSize="64">
                <AppenderRef ref="ERROR_FILE" />
                <AppenderRef ref="DEBUG_FILE" />
        </Async>
  </Appenders>  <Loggers>
        <Logger name="ua" level="debug" />
        <Logger name="ua.cetelem.DossierAnalyser" level="info" />
        <Logger name="ua.cetelem.dbaccess.DbAccess" level="info" />
        <Logger name="com.usb" level="debug" />
        <Logger name="jacorb" level="info"/>
        <Logger name="org.owasp" level="trace"/>
    <Root level="info">
      <AppenderRef ref="ASYNC"/>
    </Root>
  </Loggers></Configuration>
{code}
My client side log4j2 xml configuration below
{code:java}
<Configuration xmlns="http://logging.apache.org/log4j/2.0/config";>      
<Appenders>
        <Socket name="logfinal" host="localhost" port="1101">
                <JSONLayout/>
        </Socket>               <RollingFile name="ERROR_FILE"
                        
fileName="build/${sys:LOG4J_APP_NAME:-}-error-${HOST_NAME_SHORT}.log"
                        
filePattern="build/${sys:LOG4J_APP_NAME:-}-error-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
                        <ThresholdFilter level="warn" />
                        <PatternLayout
                                pattern="%d{DEFAULT} %-5p %t %c %x - %m%n" />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1" />
                        </Policies>
                </RollingFile>          <RollingFile name="DEBUG_FILE"
                        
fileName="build/${sys:LOG4J_APP_NAME:-}-debug-${env:NAME_SHORT}.log"
                        
filePattern="build/${sys:LOG4J_APP_NAME:-}-debug-${env:NAME_SHORT}.log.%d{yyyy-MM-dd}">
                        <ThresholdFilter level="debug" />
                        <PatternLayout
                                pattern="%d{DEFAULT} %-5p %t %c %x - %m%n" />
                        <Policies>
                                <TimeBasedTriggeringPolicy interval="1" />
                        </Policies>
                </RollingFile>
                
                <Async name="ASYNC" bufferSize="64">
                        <AppenderRef ref="ERROR_FILE" />
                        <AppenderRef ref="DEBUG_FILE" />
                        <AppenderRef ref="logfinal" />
                </Async>
        
    </Appenders>        <Loggers>
                <Logger name="org.hibernate.tool.hbm2ddl" level="DEBUG" />
                <Logger name="org.hibernate.SQL" level="INFO" />
                <Logger name="ua.cetelem" level="debug" />
                <Root level="info">
                        <Property name="application">app_name</Property>
                        <AppenderRef ref="ASYNC" />
                </Root>
        </Loggers>
</Configuration>
{code}
I need a help to resolve an issue with high load CPU on the logger server, what 
could be the problem and which could be options to resolve this problem?

 

        Summary: TcpSocketServer over load CPU  (was: TcpSocketAppender over 
load CPU)

> TcpSocketServer over load CPU
> -----------------------------
>
>                 Key: LOG4J2-3057
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3057
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>            Reporter: Mykola Holovach
>            Priority: Major
>
> My server log4j2 xml configuration below
> {code:java}
> <Configuration xmlns="http://logging.apache.org/log4j/2.0/config";>  
> <Appenders>
>       <RollingRandomAccessFile name="ERROR_FILE" bufferSize="1024" 
> bufferedIO="true" append="true"
>               fileName="${LOGS_HOME}/logfinal-error-${HOST_NAME_SHORT}.log"
>               
> filePattern="${LOGS_HOME}/logfinal-error-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
>               <ThresholdFilter level="warn" />
>               <PatternLayout pattern="%d{DEFAULT} %-5p %t %c %X{application} 
> %x - %m%n" />
>           <Policies>
>               <TimeBasedTriggeringPolicy interval="1"/>
>           </Policies>
>       </RollingRandomAccessFile>      <RollingRandomAccessFile 
> name="DEBUG_FILE" bufferSize="32768" bufferedIO="true" append="true" 
>               fileName="${LOGS_HOME}/logfinal-debug-${HOST_NAME_SHORT}.log"
>               
> filePattern="${LOGS_HOME}/logfinal-debug-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
>               <ThresholdFilter level="debug" />
>               <PatternLayout pattern="%d{DEFAULT} %-5p %t %c ${application} 
> %x - %m%n" />
>           <Policies>
>               <TimeBasedTriggeringPolicy interval="1"/>
>           </Policies>
>       </RollingRandomAccessFile>      <Async name="ASYNC" bufferSize="64">
>               <AppenderRef ref="ERROR_FILE" />
>               <AppenderRef ref="DEBUG_FILE" />
>       </Async>
>   </Appenders>  <Loggers>
>       <Logger name="ua" level="debug" />
>       <Logger name="ua.cetelem.DossierAnalyser" level="info" />
>       <Logger name="ua.cetelem.dbaccess.DbAccess" level="info" />
>       <Logger name="com.usb" level="debug" />
>       <Logger name="jacorb" level="info"/>
>       <Logger name="org.owasp" level="trace"/>
>     <Root level="info">
>       <AppenderRef ref="ASYNC"/>
>     </Root>
>   </Loggers></Configuration>
> {code}
> My client side log4j2 xml configuration below
> {code:java}
> <Configuration xmlns="http://logging.apache.org/log4j/2.0/config";>    
> <Appenders>
>         <Socket name="logfinal" host="localhost" port="1101">
>               <JSONLayout/>
>         </Socket>             <RollingFile name="ERROR_FILE"
>                       
> fileName="build/${sys:LOG4J_APP_NAME:-}-error-${HOST_NAME_SHORT}.log"
>                       
> filePattern="build/${sys:LOG4J_APP_NAME:-}-error-${HOST_NAME_SHORT}.log.%d{yyyy-MM-dd}">
>                       <ThresholdFilter level="warn" />
>                       <PatternLayout
>                               pattern="%d{DEFAULT} %-5p %t %c %x - %m%n" />
>                       <Policies>
>                               <TimeBasedTriggeringPolicy interval="1" />
>                       </Policies>
>               </RollingFile>          <RollingFile name="DEBUG_FILE"
>                       
> fileName="build/${sys:LOG4J_APP_NAME:-}-debug-${env:NAME_SHORT}.log"
>                       
> filePattern="build/${sys:LOG4J_APP_NAME:-}-debug-${env:NAME_SHORT}.log.%d{yyyy-MM-dd}">
>                       <ThresholdFilter level="debug" />
>                       <PatternLayout
>                               pattern="%d{DEFAULT} %-5p %t %c %x - %m%n" />
>                       <Policies>
>                               <TimeBasedTriggeringPolicy interval="1" />
>                       </Policies>
>               </RollingFile>
>               
>               <Async name="ASYNC" bufferSize="64">
>                       <AppenderRef ref="ERROR_FILE" />
>                       <AppenderRef ref="DEBUG_FILE" />
>                       <AppenderRef ref="logfinal" />
>               </Async>
>         
>     </Appenders>      <Loggers>
>               <Logger name="org.hibernate.tool.hbm2ddl" level="DEBUG" />
>               <Logger name="org.hibernate.SQL" level="INFO" />
>               <Logger name="ua.cetelem" level="debug" />
>               <Root level="info">
>                       <Property name="application">app_name</Property>
>                       <AppenderRef ref="ASYNC" />
>               </Root>
>       </Loggers>
> </Configuration>
> {code}
> I need a help to resolve an issue with high load CPU on the logger server, 
> with SocketAppender, what could be the problem and which could be options to 
> resolve this problem?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to