【问题标题】:append line of code and datetime in microlog在微日志中附加代码行和日期时间
【发布时间】:2012-10-29 05:29:20
【问题描述】:

目前我在 microlog.properties 文件中使用如下所示。

microlog.formatter.PatternFormatter.pattern=[%d]:[%P] %c - %m %T

得到的结果是Microlog 38623:[INFO]-this is my class.

我想获取 1) 日期时间为 29-10-2012 : 21:55:40 和 2) append the line of the class 到日志文件。

如何设置属性文件来设置两者?

【问题讨论】:

    标签: android logging


    【解决方案1】:

    %d 的默认时间说明符是绝对时间。尝试指定您喜欢如何格式化时间,例如%d{ISO8601}

    Microlog4Android 的灵感来自 Log4j,因此它支持其许多功能。 Microlog4Android 中的格式化程序包含PatternLayout 中的许多模式。

    【讨论】:

    • @kitokid:这解决了你的问题吗?很高兴知道。
    猜你喜欢
    • 1970-01-01
    • 2022-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多