[jira] [Commented] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
[ https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17516640#comment-17516640 ] Ragini Gawande commented on LOG4J2-3436: Thanks [~pkarwasz] for the details, We can close this issue as the latest snapshot is fixing our issue > Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname > -- > > Key: LOG4J2-3436 > URL: https://issues.apache.org/jira/browse/LOG4J2-3436 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders, Log4j 1.2 bridge > Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 > log4j-1.2-api-2.17.3.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > We are trying to use syslogAppender for our logging but in the logs its > prints localhost.localdomain instead of actual hostname > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can > print FINE > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can > print Info > > Here we are using snapshot version of log4j 2.17.3 > This issue was not seen when using log4j 2.17.1 > > Additional info: > JDK 1.8 > -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Comment Edited] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
[ https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17516624#comment-17516624 ] Ragini Gawande edited comment on LOG4J2-3436 at 4/4/22 5:50 AM: Hi [~pkarwasz], My issue is solved in the latest snapshot version. Thanks for getting this solved. Before closing this issue can you help me with the date by which the final build of 2.17.3 will be released? Asking this because [https://logging.apache.org/log4j/2.x/download.html] still has 2.17.2 as latest log4j version was (Author: JIRAUSER285931): Hi [~pkarwasz], My issue is solved in the latest snapshot version. Thanks for getting this solved. Before closing this issue can you help me with the date by which the final build of 2.17.3 will be released? > Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname > -- > > Key: LOG4J2-3436 > URL: https://issues.apache.org/jira/browse/LOG4J2-3436 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders, Log4j 1.2 bridge > Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 > log4j-1.2-api-2.17.3.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > We are trying to use syslogAppender for our logging but in the logs its > prints localhost.localdomain instead of actual hostname > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can > print FINE > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can > print Info > > Here we are using snapshot version of log4j 2.17.3 > This issue was not seen when using log4j 2.17.1 > > Additional info: > JDK 1.8 > -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
[ https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17516624#comment-17516624 ] Ragini Gawande commented on LOG4J2-3436: Hi [~pkarwasz], My issue is solved in the latest snapshot version. Thanks for getting this solved. Before closing this issue can you help me with the date by which the final build of 2.17.3 will be released? > Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname > -- > > Key: LOG4J2-3436 > URL: https://issues.apache.org/jira/browse/LOG4J2-3436 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders, Log4j 1.2 bridge > Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 > log4j-1.2-api-2.17.3.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > We are trying to use syslogAppender for our logging but in the logs its > prints localhost.localdomain instead of actual hostname > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can > print FINE > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can > print Info > > Here we are using snapshot version of log4j 2.17.3 > This issue was not seen when using log4j 2.17.1 > > Additional info: > JDK 1.8 > -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
[ https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17515216#comment-17515216 ] Ragini Gawande commented on LOG4J2-3436: Hi [~pkarwasz], Any update on this issue? When can we expect a snapshot version with the fix to LOG4J-3359 If possible can you share the date by which the snapshot version will be available? > Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname > -- > > Key: LOG4J2-3436 > URL: https://issues.apache.org/jira/browse/LOG4J2-3436 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders, Log4j 1.2 bridge > Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 > log4j-1.2-api-2.17.3.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > We are trying to use syslogAppender for our logging but in the logs its > prints localhost.localdomain instead of actual hostname > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can > print FINE > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can > print Info > > Here we are using snapshot version of log4j 2.17.3 > This issue was not seen when using log4j 2.17.1 > > Additional info: > JDK 1.8 > -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
[ https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17512265#comment-17512265 ] Ragini Gawande commented on LOG4J2-3436: [~pkarwasz] Any plan to get this fixed in the next log4j version to get the behavior same as 2.17.1? or any other way if you can suggest(any configuration which we can do on our side) to get this issue fixed > Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname > -- > > Key: LOG4J2-3436 > URL: https://issues.apache.org/jira/browse/LOG4J2-3436 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders, Log4j 1.2 bridge > Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 > log4j-1.2-api-2.17.3.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > We are trying to use syslogAppender for our logging but in the logs its > prints localhost.localdomain instead of actual hostname > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can > print FINE > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can > print Info > > Here we are using snapshot version of log4j 2.17.3 > This issue was not seen when using log4j 2.17.1 > > Additional info: > JDK 1.8 > -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
[ https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17511844#comment-17511844 ] Ragini Gawande commented on LOG4J2-3436: [~pkarwasz] I tried the work around suggested by you, but still getting same issue. At first when we upgraded from log4j 1.x to 2.x we were getting same issue where localhost.localdomain was printed instead of actual host then we made the following change and the issue was solved SyslogAppender conversion pattern before change: log4j.appender.SYSLOG.layout.ConversionPattern=Main[%pid] :%t: %c %-4p - %m%n SyslogAppender conversion pattern after the change which solved our issue: log4j.appender.SYSLOG.layout.ConversionPattern={*}${hostName}{*} Main[%pid] :%t: %c %-4p - %m%n This was working fine till log4j 2.17.1 Further when we upgraded to log4j 2.17.2 we stared getting the issue again and we also tried removing *${hostName}* but it didn't help Is there anything we are missing in the conversion Pattern of the properties file which is newly added after 2.17.1? > Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname > -- > > Key: LOG4J2-3436 > URL: https://issues.apache.org/jira/browse/LOG4J2-3436 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders, Log4j 1.2 bridge > Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 > log4j-1.2-api-2.17.3.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > We are trying to use syslogAppender for our logging but in the logs its > prints localhost.localdomain instead of actual hostname > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can > print FINE > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can > print Info > > Here we are using snapshot version of log4j 2.17.3 > This issue was not seen when using log4j 2.17.1 > > Additional info: > JDK 1.8 > -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17511613#comment-17511613 ] Ragini Gawande commented on LOG4J2-3419: [~pkarwasz], The latest snapshot version is giving us the expected output 2022-03-24 11:56:21,249 Main[35716] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-24 11:56:21,249 Main[35716] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-24 11:56:21,249 Main[35716] :main: example.com.Test WARNING - Ragini Level.WARNING log 2022-03-24 11:56:21,249 Main[35716] :main: example.com.Test SEVERE - Ragini Level.SEVERE log 2022-03-24 11:56:21,249 Main[35716] :main: example.com.Test UM_INFO - Ragini Level.UM_INFO log 2022-03-24 11:56:21,250 Main[35716] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-24 11:56:21,250 Main[35716] :main: example.com.Test CONFIG - Ragini Level.CONFIG log 2022-03-24 11:56:21,250 Main[35716] :main: example.com.Test FINE - Ragini Level.FINE log 2022-03-24 11:56:21,250 Main[35716] :main: example.com.Test FINER - Ragini Level.FINER log 2022-03-24 11:56:21,250 Main[35716] :main: example.com.Test FINEST - Ragini Level.FINEST log Thanks for getting this issues resolved. > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip, Level.java, log4j.properties > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17511075#comment-17511075 ] Ragini Gawande commented on LOG4J2-3419: [~pkarwasz] , I verified my code with the latest snapshot created on March 21st with that patch the log levels are printed correctly but the ID is not printed correctly {noformat} 2022-03-23 13:10:14,862 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-23 13:10:14,863 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-23 13:10:14,863 Main[WARNINGid] :main: example.com.Test WARNING - Ragini Level.WARNING log 2022-03-23 13:10:14,864 Main[SEVEREid] :main: example.com.Test SEVERE - Ragini Level.SEVERE log 2022-03-23 13:10:14,864 Main[UM_INFOid] :main: example.com.Test UM_INFO - Ragini Level.UM_INFO log 2022-03-23 13:10:14,864 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-23 13:10:14,864 Main[CONFIGid] :main: example.com.Test CONFIG - Ragini Level.CONFIG log 2022-03-23 13:10:14,864 Main[FINEid] :main: example.com.Test FINE - Ragini Level.FINE log 2022-03-23 13:10:14,864 Main[FINERid] :main: example.com.Test FINER - Ragini Level.FINER log 2022-03-23 13:10:14,865 Main[FINESTid] :main: example.com.Test FINEST - Ragini Level.FINEST log{noformat} Here instead of printing the id its printing FATALid String > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip, Level.java, log4j.properties > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Updated] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ragini Gawande updated LOG4J2-3419: --- Attachment: log4j.properties > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip, Level.java, log4j.properties > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Updated] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ragini Gawande updated LOG4J2-3419: --- Attachment: (was: log4j.properties) > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip, Level.java, log4j.properties > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Comment Edited] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508008#comment-17508008 ] Ragini Gawande edited comment on LOG4J2-3419 at 3/17/22, 7:16 AM: -- [~pkarwasz] I have attached the custom Level.java class which has {{public static Level toLevel(String, Level)}} method. I have also attached the log4j.properties file which we are using In this file if we keep rootlogger as log4j.rootLogger=FINEST#{*}org.apache.log4j.helpers.UtilLoggingLevel{*}, TRACE_LOGGER, stdout, SYSLOG then the output we get is as followed, here it prints all logs for FINEST level and above but the custom level are printed as ERROR 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINER log 2022-03-16 16:45:05,844 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINEST log And if we keep rootlogger as log4j.rootLogger=FINEST#com.test.common.logging.Level, TRACE_LOGGER, stdout, SYSLOG it considers FINEST as debug by default and prints all logs for DEBUG level and above and the custom level are still printed as ERROR 2022-03-17 12:07:55,037 DmccMain[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-17 12:07:55,040 DmccMain[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-17 12:07:55,040 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-17 12:07:55,040 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-17 12:07:55,041 DmccMain[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log 2022-03-17 12:07:55,042 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINER log 2022-03-17 12:07:55,042 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINEST log 2022-03-17 12:07:55,042 DmccMain[DEBUGid] :main: example.com.Test DEBUG - Ragini Level.DEBUG log was (Author: JIRAUSER285931): [~pkarwasz] I have attached the custom Level.java class which has {{public static Level toLevel(String, Level)}} method. I have also attached the log4j.properties file which we are using In this file if we keep rootlogger as log4j.rootLogger=FINEST#{*}org.apache.log4j.helpers.UtilLoggingLevel{*}, TRACE_LOGGER, stdout, SYSLOG then the output we get is as followed, here it prints all logs for FINEST level and above but the custom level are printed as ERROR 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log 2022-03-16 16:45:05,843 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINER log 2022-03-16 16:45:05,844 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINEST log And if we keep rootlogger as log4j.rootLogger=FINEST#com.test.common.logging.Level, TRACE_LOGGER, stdout, SYSLOG it considers FINEST as debug by default and prints all logs for DEBUG level and above and the custom level
[jira] [Comment Edited] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508008#comment-17508008 ] Ragini Gawande edited comment on LOG4J2-3419 at 3/17/22, 7:16 AM: -- [~pkarwasz] I have attached the custom Level.java class which has {{public static Level toLevel(String, Level)}} method. I have also attached the log4j.properties file which we are using In this file if we keep rootlogger as log4j.rootLogger=FINEST#{*}org.apache.log4j.helpers.UtilLoggingLevel{*}, TRACE_LOGGER, stdout, SYSLOG then the output we get is as followed, here it prints all logs for FINEST level and above but the custom level are printed as ERROR 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log 2022-03-16 16:45:05,843 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINER log 2022-03-16 16:45:05,844 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINEST log And if we keep rootlogger as log4j.rootLogger=FINEST#com.test.common.logging.Level, TRACE_LOGGER, stdout, SYSLOG it considers FINEST as debug by default and prints all logs for DEBUG level and above and the custom level are still printed as ERROR 2022-03-17 12:07:55,037 DmccMain[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-17 12:07:55,040 DmccMain[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-17 12:07:55,040 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-17 12:07:55,040 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-17 12:07:55,041 DmccMain[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log 2022-03-17 12:07:55,042 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINER log 2022-03-17 12:07:55,042 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINEST log 2022-03-17 12:07:55,042 DmccMain[DEBUGid] :main: example.com.Test DEBUG - Ragini Level.DEBUG log was (Author: JIRAUSER285931): [~pkarwasz] I have attached the custom Level.java class which has {{public static Level toLevel(String, Level)}} method. I have also attached the log4j.properties file which we are using In this file if we keep rootlogger as log4j.rootLogger=FINEST#{*}org.apache.log4j.helpers.UtilLoggingLevel{*}, TRACE_LOGGER, stdout, SYSLOG then the output we get is as followed, here it prints all logs for FINEST level and above but the custom level are printed as ERROR 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log And if we keep rootlogger as log4j.rootLogger=FINEST#com.test.common.logging.Level, TRACE_LOGGER, stdout, SYSLOG it considers FINEST as debug by default and prints all logs for DEBUG level and above and the custom level are still printed as ERROR 2022-03-17 12:07:55,037 DmccMain[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-17 12:07:55,040 DmccMain[FATALid] :main: example.com.Test
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508008#comment-17508008 ] Ragini Gawande commented on LOG4J2-3419: [~pkarwasz] I have attached the custom Level.java class which has {{public static Level toLevel(String, Level)}} method. I have also attached the log4j.properties file which we are using In this file if we keep rootlogger as log4j.rootLogger=FINEST#{*}org.apache.log4j.helpers.UtilLoggingLevel{*}, TRACE_LOGGER, stdout, SYSLOG then the output we get is as followed, here it prints all logs for FINEST level and above but the custom level are printed as ERROR 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log And if we keep rootlogger as log4j.rootLogger=FINEST#com.test.common.logging.Level, TRACE_LOGGER, stdout, SYSLOG it considers FINEST as debug by default and prints all logs for DEBUG level and above and the custom level are still printed as ERROR 2022-03-17 12:07:55,037 DmccMain[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-17 12:07:55,040 DmccMain[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-17 12:07:55,040 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-17 12:07:55,040 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-17 12:07:55,041 DmccMain[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-17 12:07:55,041 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log 2022-03-17 12:07:55,042 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINER log 2022-03-17 12:07:55,042 DmccMain[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINEST log 2022-03-17 12:07:55,042 DmccMain[DEBUGid] :main: example.com.Test DEBUG - Ragini Level.DEBUG log > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip, Level.java, log4j.properties > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Updated] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ragini Gawande updated LOG4J2-3419: --- Attachment: log4j.properties > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip, Level.java, log4j.properties > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Updated] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ragini Gawande updated LOG4J2-3419: --- Attachment: Level.java > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip, Level.java, log4j.properties > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Comment Edited] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17507518#comment-17507518 ] Ragini Gawande edited comment on LOG4J2-3419 at 3/16/22, 11:25 AM: --- [~pkarwasz] I tried with the new snapshot version log4j-1.2-api-2.17.3-snapshot.jar but I getting following results 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log Here for all the custom levels its printing ERROR instead of printing actual custom level and also the IDs are not printed. was (Author: JIRAUSER285931): [~pkarwasz] I tried with the new snapshot version log4j-1.2-api-2.17.3-snapshot.jar but I getting following results 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log Here for all the custom levels its printing ERROR instead of printing actual custom level > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17507518#comment-17507518 ] Ragini Gawande commented on LOG4J2-3419: [~pkarwasz] I tried with the new snapshot version log4j-1.2-api-2.17.3-snapshot.jar but I getting following results 2022-03-16 16:45:05,836 Main[OFFid] :main: example.com.Test OFF - Ragini Level.OFF log 2022-03-16 16:45:05,839 Main[FATALid] :main: example.com.Test FATAL - Ragini Level.FATAL log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.ERROR log 2022-03-16 16:45:05,840 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.WARNING log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.SEVERE log 2022-03-16 16:45:05,841 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.UM_INFO log 2022-03-16 16:45:05,841 Main[INFOid] :main: example.com.Test INFO - Ragini Level.INFO log 2022-03-16 16:45:05,842 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.CONFIG log 2022-03-16 16:45:05,843 Main[ERRORid] :main: example.com.Test ERROR - Ragini Level.FINE log Here for all the custom levels its printing ERROR instead of printing actual custom level > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
[ https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17507353#comment-17507353 ] Ragini Gawande commented on LOG4J2-3436: [~pkarwasz] I am using RHEL 7.6 and 'uname -n' and 'hostname' is giving correct hostname [root@rag101ga ~]# uname -n rag101ga [root@rag101ga ~]# hostname rag101ga > Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname > -- > > Key: LOG4J2-3436 > URL: https://issues.apache.org/jira/browse/LOG4J2-3436 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders, Log4j 1.2 bridge > Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 > log4j-1.2-api-2.17.3.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > We are trying to use syslogAppender for our logging but in the logs its > prints localhost.localdomain instead of actual hostname > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can > print FINE > <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 > com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can > print Info > > Here we are using snapshot version of log4j 2.17.3 > This issue was not seen when using log4j 2.17.1 > > Additional info: > JDK 1.8 > -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Created] (LOG4J2-3436) Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname
Ragini Gawande created LOG4J2-3436: -- Summary: Log4j 2 syslogAppender prints localhost.localdomain instead of actual hostname Key: LOG4J2-3436 URL: https://issues.apache.org/jira/browse/LOG4J2-3436 Project: Log4j 2 Issue Type: Bug Components: Log4j 1.2 bridge Environment: Using log4j 2 bridge API: snapshot version of 2.17.3 log4j-1.2-api-2.17.3.jar Reporter: Ragini Gawande We are trying to use syslogAppender for our logging but in the logs its prints localhost.localdomain instead of actual hostname <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can print FINE <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can print Info Here we are using snapshot version of log4j 2.17.3 This issue was not seen when using log4j 2.17.1 Additional info: JDK 1.8 -Dlog4j1.compatibility=true -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17506927#comment-17506927 ] Ragini Gawande commented on LOG4J2-3419: [~pkarwasz] We have seen one more issue after using the new snapshot of version 2.17.3 <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 com.test.common.logging.Test | FINE#com.test.common.logging.Level - Can print FINE <13>Mar 14 22:33:41 *localhost.localdomain* Main[6133] +05:30 2022 572 1 com.test.common.logging.Test | INFO#com.test.common.logging.Level - Can print Info Here instead of printing the actual hostname its printing localhost.localdomain This issue was not seen when using 2.17.1 > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Reopened] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ragini Gawande reopened LOG4J2-3419: [~pkarwasz] , I am reopening this Jira because we are getting a small issues 2022-03-14 15:24:13,177 Main[3520] :main: com.test.common.logging.Test ERROR#com.test.common.logging.Level - Can print ERROR 2022-03-14 15:24:13,181 Main[3520] :main: com.test.common.logging.Test INFO#com.test.common.logging.Level - Can print Info 2022-03-14 15:24:13,181 Main[3520] :main: com.test.common.logging.Test FINE#com.test.common.logging.Level - Can print FINE Here instead on printing just Level name ERROR, its printing ERROR#com.test.common.logging.Level > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Closed] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ragini Gawande closed LOG4J2-3419. -- > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17506105#comment-17506105 ] Ragini Gawande commented on LOG4J2-3419: Thanks [~pkarwasz] for getting this issue solved. > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17506049#comment-17506049 ] Ragini Gawande commented on LOG4J2-3419: [~pkarwasz] , When can we find the link to new version 2.17.3 [https://logging.apache.org/log4j/2.x/download.html] this link has the latest as 2.17.2 > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > Fix For: 2.17.3 > > Attachments: DemoCustom.zip > > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Comment Edited] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17502276#comment-17502276 ] Ragini Gawande edited comment on LOG4J2-3419 at 3/7/22, 1:46 PM: - I did some debugging here and following is my finding log4j-1.2-api/src/main/java/org/apache/log4j/helpers/OptionConverter.java {noformat} 157 public static Level toLevel(String value, Level defaultValue) { 158 if (value == null) { 159 return defaultValue; 160 } 161 162 value = value.trim(); 163 164 int hashIndex = value.indexOf('#'); 165 if (hashIndex == -1) { 166 if ("NULL".equalsIgnoreCase(value)) { 167 return null; 168 } 169 // no class name specified : use standard Level class 170 return Level.toLevel(value, defaultValue); 171 }{noformat} here its using Level.toLevel(value, defaultValue) of org.apache.log4j.Level instead of org.apache.logging.log4j.Level.toLevel as we have defined new custom levels in org.apache.logging.log4j.Level.forName() its unable to return the correct level from org.apache.log4j.Level and instead of actual level it returns defaultValue which is DEBUG. Can you please verify if the findings are correct? if yes then please suggest a way to define custom logging level for org.apache.log4j.Level was (Author: JIRAUSER285931): I did some debugging here and following is my finding log4j-1.2-api/src/main/java/org/apache/log4j/helpers/OptionConverter.java {noformat} 157 public static Level toLevel(String value, Level defaultValue) { 158 if (value == null) { 159 return defaultValue; 160 } 161 162 value = value.trim(); 163 164 int hashIndex = value.indexOf('#'); 165 if (hashIndex == -1) { 166 if ("NULL".equalsIgnoreCase(value)) { 167 return null; 168 } 169 // no class name specified : use standard Level class 170 return Level.toLevel(value, defaultValue); 171 }{noformat} here its using Level.toLevel(value, defaultValue) of org.apache.log4j.Level instead of org.apache.logging.log4j.Level.toLevel as we have defined new custom levels in org.apache.logging.log4j.Level.forName() its unable to return the correct level from org.apache.log4j.Level and instead of actual level it returns defaultValue which is DEBUG. Can you please verify if the findings are correct? if yes then please suggest a way to define custom logging level for org.apache.log4j.Level > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17502276#comment-17502276 ] Ragini Gawande commented on LOG4J2-3419: I did some debugging here and following is my finding log4j-1.2-api/src/main/java/org/apache/log4j/helpers/OptionConverter.java {noformat} 157 public static Level toLevel(String value, Level defaultValue) { 158 if (value == null) { 159 return defaultValue; 160 } 161 162 value = value.trim(); 163 164 int hashIndex = value.indexOf('#'); 165 if (hashIndex == -1) { 166 if ("NULL".equalsIgnoreCase(value)) { 167 return null; 168 } 169 // no class name specified : use standard Level class 170 return Level.toLevel(value, defaultValue); 171 }{noformat} here its using Level.toLevel(value, defaultValue) of org.apache.log4j.Level instead of org.apache.logging.log4j.Level.toLevel as we have defined new custom levels in org.apache.logging.log4j.Level.forName() its unable to return the correct level from org.apache.log4j.Level and instead of actual level it returns defaultValue which is DEBUG. Can you please verify if the findings are correct? if yes then please suggest a way to define custom logging level for org.apache.log4j.Level > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17502083#comment-17502083 ] Ragini Gawande commented on LOG4J2-3419: [~ggregory] / [~rgoers] Following is the GitHub link to the code which is failing [https://github.com/raginigawande/log4j_test] Additional info: JDK 1.8 -Dlog4j1.compatibility=true *Expected output after running this Test.java* {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log{noformat} *Actual output:* {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test INFO - Level.INFO log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test CONFIG - Level.CONFIG log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test FINE - Level.FINE log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINER - Level.FINER log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINEST - Level.FINEST log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test DEBUG - Level.DEBUG log{noformat} > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Assignee: Piotr Karwasz >Priority: Blocker > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17500516#comment-17500516 ] Ragini Gawande commented on LOG4J2-3419: [~rgoers] / [~ggregory] Can any of you help me with the issue mentioned in the above comment? > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Priority: Blocker > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Comment Edited] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1749#comment-1749 ] Ragini Gawande edited comment on LOG4J2-3419 at 3/2/22, 9:14 AM: - I have modified my constructor as suggested and it is giving me expected results in terms of printing the Level name correctly But I am still facing an issue while setting that custom log level in my log4j.properties file public static final int SEVERE_INT = 320; public static final Level SEVERE = new Level(SEVERE_INT, "SEVERE", 2); Now if I use SEVERE in properties file it consider it to be DEBUG by default Following is my log4j,properties file {noformat} CustomLevels=SEVERE CustomLevel.SEVERE.name=SEVERE CustomLevel.SEVERE.intLevel=320 #customLevel.SEVERE=320 log4j.rootLogger=SEVERE, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender #log4j.appender.stdout.Threshold=SEVERE log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d Main[%pid] :%t: %c %-4p - %m%n{noformat} I tried setting CustomLevels properties but still not getting expected result Expected output {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log{noformat} Actual output: {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test INFO - Level.INFO log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test CONFIG - Level.CONFIG log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test FINE - Level.FINE log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINER - Level.FINER log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINEST - Level.FINEST log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test DEBUG - Level.DEBUG log{noformat} Is there anything am missing or configuring incorrectly? was (Author: JIRAUSER285931): I have modified my constructor as suggested and it is giving me expected results in terms of printing the Level name correctly But I am still facing an issue while setting that custom log level in my log4j.properties file public static final int SEVERE_INT = 320; public static final Level SEVERE = new Level(SEVERE_INT, "SEVERE", 2); Now if I use SEVERE in properties file it consider it to be DEBUG by default Following is my log4j,properties file {noformat} CustomLevels=SEVERE CustomLevel.SEVERE.name=SEVERE CustomLevel.SEVERE.intLevel=320 #customLevel.SEVERE=320 log4j.rootLogger=SEVERE, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender #log4j.appender.stdout.Threshold=SEVERE log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d Main[%pid] :%t: %c %-4p - %m%n{noformat} I tried setting CustomLevels properties but still not getting expected result Expected output {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log{noformat} Actual output: {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test INFO - Level.INFO log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test CONFIG - Level.CONFIG log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test FINE - Level.FINE log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINER - Level.FINER log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINEST - Level.FINEST log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test DEBUG - Level.DEBUG log{noformat} Is there anything am missing or configuring incorrectly? > Unable to create
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1749#comment-1749 ] Ragini Gawande commented on LOG4J2-3419: I have modified my constructor as suggested and it is giving me expected results in terms of printing the Level name correctly But I am still facing an issue while setting that custom log level in my log4j.properties file public static final int SEVERE_INT = 320; public static final Level SEVERE = new Level(SEVERE_INT, "SEVERE", 2); Now if I use SEVERE in properties file it consider it to be DEBUG by default Following is my log4j,properties file {noformat} CustomLevels=SEVERE CustomLevel.SEVERE.name=SEVERE CustomLevel.SEVERE.intLevel=320 #customLevel.SEVERE=320 log4j.rootLogger=SEVERE, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender #log4j.appender.stdout.Threshold=SEVERE log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d Main[%pid] :%t: %c %-4p - %m%n{noformat} I tried setting CustomLevels properties but still not getting expected result Expected output {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log{noformat} Actual output: {noformat} 2022-03-02 14:22:49,982 Main[11728] :main: example.com.Test FATAL - Level.FATAL log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test ERROR - Level.ERROR log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test WARNING - Level.WARNING log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test SEVERE - Level.SEVERE log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test INFO - Level.INFO log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test CONFIG - Level.CONFIG log 2022-03-02 14:22:49,986 Main[11728] :main: example.com.Test FINE - Level.FINE log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINER - Level.FINER log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test FINEST - Level.FINEST log 2022-03-02 14:22:49,987 Main[11728] :main: example.com.Test DEBUG - Level.DEBUG log{noformat} Is there anything am missing or configuring incorrectly? > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Priority: Blocker > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17499653#comment-17499653 ] Ragini Gawande commented on LOG4J2-3419: This same code worked with log4j 1.2.x, we were able to see our custom level printed properly. Is there any plan to fix this for log4j 2 bridge API? Or is there any other way by which I can create the custom log level using log4j bridge API? > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Priority: Blocker > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (LOG4J2-3419) Unable to create custom logging level using log4j 2 Bridge API
[ https://issues.apache.org/jira/browse/LOG4J2-3419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17499643#comment-17499643 ] Ragini Gawande commented on LOG4J2-3419: Hi [~ggregory] We have extended the org.apache.log4j.Level class as followed *public class Level extends org.apache.log4j.Level* and the constructor in my extended class Level is: {color:#172b4d} *private Level(int paramInt1, String paramString, int paramInt2)*{color} {color:#172b4d} *{*{color} {color:#172b4d} *super(paramInt1, paramString, paramInt2);*{color} {color:#172b4d} *}*{color} We are then creating our custom logging level in my extended Level class as mentioned in the description _public static final int FINE_INT = 13000;_ _public static final Level FINE = new Level(FINE_INT, "FINE", 7);_ > Unable to create custom logging level using log4j 2 Bridge API > -- > > Key: LOG4J2-3419 > URL: https://issues.apache.org/jira/browse/LOG4J2-3419 > Project: Log4j 2 > Issue Type: Bug > Components: Log4j 1.2 bridge >Affects Versions: 2.17.1 > Environment: Using log4j 2 bridge API: log4j-1.2-api-2.17.1.jar >Reporter: Ragini Gawande >Priority: Blocker > > Unable to create custom logging level using log4j 2 Bridge API > Following did not create a custom logging level > *public static final int FINE_INT = 13000;* > *public static final Level FINE = new Level(FINE_INT, "FINE", 7);* > > Using FINE logging level is considered to be DEBUG level by default while > printing it > *Adding log:* > log.log({*}Level.FINE{*},"PRINT: Level.FINE log"); > > *Expected log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *FINE* - PRINT: > Level.FINE log > > *Actual log printed:* > 2022-02-25 15:50:09,208 Main[6788] :main: example.com.Test *DEBUG* - PRINT: > Level.FINE log -- This message was sent by Atlassian Jira (v8.20.1#820001)