新贵日志中的时间戳

blu*_*mpb 8 logging upstart

我在Ubuntu上使用upstart来管理服务.它写道/var/log/upstart/<service>.log.此文件中的错误没有时间戳,这使得诊断问题变得困难.

是否有一种方法 - 配置文件中的某种类型 - 告诉upstart用其日志输出写入时间戳?

dam*_*ier 0

可能有一种更优雅的方法来做你想做的事,但我发现以下贫民区方法足够有效:

           echo "`date` : Doing the next thing..."
Run Code Online (Sandbox Code Playgroud)