log4j alignment
通过检查IntelliJ IDEA的日志输出,我注意到对齐非常好(由于类名称正确对齐和修剪的事实)。
你是如何使用log4J做到这一点的?你需要一个特殊的appender吗?
2011-01-08 00:48:53,938 [ 2537] INFO - ellij.vfs.persistent.FSRecords - Marking VFS as corrupted
2011-01-08 00:48:53,987 [ 2586] INFO - api.vfs.impl.local.FileWatcher - Native file watcher is operational.
2011-01-08 00:48:54,034 [ 2633] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/other.xml file is null
2011-01-08 00:48:54,035 [ 2634] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/other.xml
2011-01-08 00:48:54,046 [ 2645] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/project.default.xml file is null
2011-01-08 00:48:54,047 [ 2646] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/project.default.xml
2011-01-08 00:48:54,051 [ 2650] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/options.xml file is null
2011-01-08 00:48:54,051 [ 2650] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/options.xml
2011-01-08 00:48:54,295 [ 2894] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/filetypes.xml file is null
2011-01-08 00:48:54,295 [ 2894] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/filetypes.xml
2011-01-08 00:48:54,342 [ 2941] INFO - .history.utils.LocalHistoryLog - local history version mismatch (was: 0, expected: 5), rebuilding...
2011-01-08 00:48:54,342 [ 2941] INFO - .history.utils.LocalHistoryLog - FS has been rebuild, rebuilding local history...
没有找到相关结果
已邀请:
1 个回复
刷遍派戳
这将导致字段总是正好20个字符宽,如果值小于20个字符,则使用空格填充左边,如果大于20,则截断它。 您问题中日志的PatternLayout可能类似于: