1

I have an example how to configure the log4j2.xml to have Windows event logging:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="TRACE">
    <Properties>
        <Property name="dllfile">src\main\resources\Win32EventLogAppender.dll</Property>
    </Properties>
    <Appenders>
        <Console name="console-log" target="SYSTEM_OUT" level="debug">
            <PatternLayout
                pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %l - %msg%n" />
        </Console>

        <Win32EventLog name="Win32EventLog" source="DemoLogger1"
            application="Win32LogApplication"
            eventMessageFile="${dllfile}"
            categoryMessageFile="${dllfile}">
            <PatternLayout pattern="%-5p [%t] %m%n" />
        </Win32EventLog>
    </Appenders>
    <Loggers>
        <Root level="trace">
            <appender-ref ref="Win32EventLog" />
            <appender-ref ref="console-log" />
        </Root>
    </Loggers>
</Configuration>

And I am just wondering. How to setup for 64bit Windows? Will it work for 64bit one, or not?

I don't have a 64bit Windows currently, so I cannot test it, and cannot find any relevant sites on the web.

Thanks!

victorio
  • 6,224
  • 24
  • 77
  • 113

1 Answers1

0

So the answer is: it is working with 64 bit also. Cheers!

victorio
  • 6,224
  • 24
  • 77
  • 113