[
https://issues.apache.org/jira/browse/LOG4J2-3436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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)