How do I configure Logback to print out the class name

后端 未结 6 1045
渐次进展
渐次进展 2020-12-10 11:08

I\'m using Play 2.1. I\'m using the default logger play.api.Logger. I\'m confused about how it works.

In my scala code, a line in class \"com.myapp.tickets\" in th

6条回答
  •  萌比男神i
    2020-12-10 11:43

    Logback pattern :

    %d{HH:mm:ss.SSS} [%thread] %-5level %class{36}.%M %L - %msg%n
    

    Result :

    14:53:47.816 [http-bio-8080-exec-3] DEBUG  c.f.s.w.s.i.example.ExServiceImpl.getStatus 993 - blocked-->0
    
    • [http-bio-8080-exec-3] is the thread name

    • c.f.s.w.s.i.example is the package name

    • ExServiceImpl is the class name

    • getStatus is method name

    • 993 is the line number

提交回复
热议问题