似乎在 Grails 或 Groovy 中,不可能将日志记录模式设置为记录行号、方法和类名。或者你可以,但你会从 Log4j 类接收行号和方法名称,如:
%F:%L -≥ SLF4JLog.java:213
我发现了一个与 Grails 无关的问题:
http://jira.grails.org/browse/GRAILS-9789
那么有什么方法可以在 Grails 中记录这些信息呢?
最佳答案
请看Grails logging - Is there any existing solution to be able to log the File + Line where the call actually occured?
因此,您需要使用自定义附加程序...
关于Grails/Groovy log4j - 记录行号、方法名和类名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18074707/