Paolo Bazzi created IGNITE-18507:
------------------------------------

             Summary: IgniteKernal logger does not respect property 
IGNITE_LOG_INSTANCE_NAME
                 Key: IGNITE-18507
                 URL: https://issues.apache.org/jira/browse/IGNITE-18507
             Project: Ignite
          Issue Type: Bug
    Affects Versions: 2.11.1
            Reporter: Paolo Bazzi


The logger instance used within IgniteKernal does not respect the system 
property IgniteSystemProperties.IGNITE_LOG_INSTANCE_NAME which allows to 
configure if the instance name should be added to log messages.

The IgniteKernal log uses this custom logic to append the instance name:

log = (GridLoggerProxy)cfg.getGridLogger().getLogger(
getClass().getName() + (igniteInstanceName != null ? '%' + igniteInstanceName : 
""));

 

Example:
2023-01-05 15:12:17,550 WARN  [platform-starter] 
org.apache.ignite.internal.IgniteKernal%My P2P 
Instance.warning(Slf4jLogger.java:127) - <My P2P Instance-55fd3fd9> Nodes 
started on local machine require more than 80% of physical RAM what can lead to 
significant slowdown due to swapping (please decrease JVM heap size, data 
region size or checkpoint buffer size) [required=6803MB, available=32549MB] - 
MDC[]


Improvement:
 * Consider IgniteSystemProperties.IGNITE_LOG_INSTANCE_NAME when appending 
instance name to IgniteKernal grid logger
 * Consider use the same log format for both logger:
 ** IgniteKernal appends instance name to logger name separated by %
 ** Other Ignite grid logger append the instance name to the log message 
separated by brackets

Background: Appending the instance name to the logger name makes custom rules 
(e.g. logback.xml log level configuration) complicated because the instance 
name must be used to configure the logger instance in logback.xml.

Example Configuration:

<logger name="org.apache.ignite.internal.IgniteKernal%My P2P Instance" 
level="ERROR" />



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to