logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Cardoso <rfonsecacard...@gmail.com>
Subject org.apache.log4j.nt.NTEventLogAppender.registerEventSource
Date Fri, 13 Jul 2012 13:34:06 GMT
Hi my name is Ricardo and I am trying to learn how to use log4j.

I am now trying to learn how to use NTEventLogAppender but without success.

I already put the NTEventLogAppender.dll in windows/system32 folder but
when I run the example code of this dll I get this exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.apache.log4j.nt.NTEventLogAppender.registerEventSource(Ljava/lang/St
ring;Ljava/lang/String;)I

                at
org.apache.log4j.nt.NTEventLogAppender.registerEventSource(Native
Method)

                at
org.apache.log4j.nt.NTEventLogAppender.<init>(NTEventLogAppender.java:79
)

                at
org.apache.log4j.nt.NTEventLogAppender.<init>(NTEventLogAppender.java:53
)

                at com.log.eventlog.Teste.main(Teste.java:15)

My java code is the following:

                    BasicConfigurator.configure(new
NTEventLogAppender("ola"));

                    Logger logger =3D
Logger.getLogger("org.apache.log4j.nt.NTEventLogAppenderTest");

                    int i  =3D 0;

                    logger.debug( "Message " + i++);

                    logger.info( "Message " + i++);

                    logger.warn( "Message " + i++);

                    logger.error( "Message " + i++);

                    logger.log(Level.FATAL, "Message " + i++);

                    logger.debug("Message " + i++,  new Exception("Just
testing."));

I know that this can be a silly error but in the internet I only get pages
that show me the  NTEventLogAppender class.

Can anyone help me?

Best Regards

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message