logback.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!--
  2. ~ Copyright (C) 2020 Prasoon Joshi
  3. ~
  4. ~ This program is free software: you can redistribute it and/or modify
  5. ~ it under the terms of the GNU General Public License as published by
  6. ~ the Free Software Foundation, either version 3 of the License, or
  7. ~ (at your option) any later version.
  8. ~
  9. ~ This program is distributed in the hope that it will be useful,
  10. ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ~ GNU General Public License for more details.
  13. ~
  14. ~ You should have received a copy of the GNU General Public License
  15. ~ along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. -->
  17. <!-- https://www.playframework.com/documentation/latest/SettingsLogger -->
  18. <configuration>
  19. <conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />
  20. <appender name="FILE" class="ch.qos.logback.core.FileAppender">
  21. <file>${application.home:-.}/logs/application.log</file>
  22. <encoder>
  23. <pattern>%date [%level] from %logger in %thread - %message%n%xException</pattern>
  24. </encoder>
  25. </appender>
  26. <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  27. <encoder>
  28. <pattern>%coloredLevel %logger{15} - %message%n%xException{10}</pattern>
  29. </encoder>
  30. </appender>
  31. <appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
  32. <appender-ref ref="FILE" />
  33. </appender>
  34. <appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
  35. <appender-ref ref="STDOUT" />
  36. </appender>
  37. <logger name="play" level="INFO" />
  38. <logger name="application" level="DEBUG" />
  39. <root level="WARN">
  40. <!--<appender-ref ref="ASYNCFILE" />-->
  41. <appender-ref ref="ASYNCSTDOUT" />
  42. </root>
  43. </configuration>