Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails / Groovy log4j - Log line numbers, method name and class name

It seems that in Grails or better to say Groovy, it is not possible to set the logging pattern to log line numbers, method and class names. Or you can but you would receive the line number and method name from Log4j class like:

%F:%L -≥ SLF4JLog.java:213

I've found an issue related to that which was no considered as Grails related: http://jira.grails.org/browse/GRAILS-9789

So is there any way how to log these information in Grails?

like image 212
kuceram Avatar asked Nov 02 '22 17:11

kuceram


1 Answers

Please take a look at Grails logging - Is there any existing solution to be able to log the File + Line where the call actually occured?

So, you need to use a custom appender...

like image 50
Svetozar Misljencevic Avatar answered Nov 15 '22 07:11

Svetozar Misljencevic