Логирование в консоль и файл работает правильно,а вот письма не шлет.
есть такие настройки :<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn" name="MyApp" packages="">
<Appenders>
<!-- SMTP appender -->
<SMTP name="Mail" subject="Logging"
to="viacheslav.belyi@gmail.com" from= "slavik58260849@gmail.com"
smtpHost="smtp.gmail.com" smtpPort="465" bufferSize="100"
smtpProtocol="smtps"
>
<PatternLayout>
<Pattern>%d{dd MM yyyy HH:mm:ss,SSS} - %msg%n</Pattern>
</PatternLayout>
</SMTP>
<!-- File appender -->
<File name="File" fileName="c:/logs/app.log">
<PatternLayout>
<Pattern>%d{dd MM yyyy HH:mm:ss,SSS} - %msg%n</Pattern>
</PatternLayout>
</File>
<!-- Console appender -->
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="error">
<AppenderRef ref="Mail"/>
<AppenderRef ref="File" />
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
пишет :
JavaFX Application Thread ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.SmtpAppender for element SMTP: java.lang.NoClassDefFoundError: javax/mail/MessagingException java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
JavaFX Application Thread ERROR Null object returned for SMTP in Appenders.
документация если что вот :
https://logging.apache.org/log4j/2.x/manual/append...