Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从 log4j 扩展 LoggingEvent 类(我想显示线程 id而不是线程名称)并保持 Logger 默认类。
如何将我自己的 LoggingEvent 类分配给现有的 Logger 类?
问候
您可以扩展PatternLayout以完成记录 ThreadId。请参阅http://java.ittoolbox.com/groups/technical-functional/javaee-l/thread-id-in-log4j-logs-2926542
PatternLayout