来自shell编程,我在那里使用了很多这样的函数:log_action(){case"${1}"in'ERROR')EXIT_CODE="${3}"echo"[${1}]|$(date+"%T")|${2}|Exiting(${EXIT_CODE})"exit${EXIT_CODE};;;'WARNING')echo"[${1}]|$(date+"%T")|${2}|Line:(${3})";;'DEBUG')if[[${DEBUG}-eq"1"]];then{echo"[${1}]|$(date+"%T")|${2}|${3}"};fi;;*)echo"[${1}]|$(date+"
来自shell编程,我在那里使用了很多这样的函数:log_action(){case"${1}"in'ERROR')EXIT_CODE="${3}"echo"[${1}]|$(date+"%T")|${2}|Exiting(${EXIT_CODE})"exit${EXIT_CODE};;;'WARNING')echo"[${1}]|$(date+"%T")|${2}|Line:(${3})";;'DEBUG')if[[${DEBUG}-eq"1"]];then{echo"[${1}]|$(date+"%T")|${2}|${3}"};fi;;*)echo"[${1}]|$(date+"
在Symfony命令执行期间,我想将消息记录到不同的文件中。我已经阅读了Symfony和Monolog文档,它应该像我在这里描述的那样工作。(请注意,我知道来自“原则”、“事件”……channel的消息仍将由主处理程序记录,但这对我来说无关紧要)在我的config.yml中,我有这个:monolog:channels:[commandline]handlers:main:type:streampath:"%kernel.logs_dir%/%kernel.environment%.main.log"level:debugchannels:[!commandline]commandlin