hsl's avatar
Level 2

remove stacktrace from log files

Hi,

How do I remove the stack trace from the laravel log files? The log file on my production server is unnecessary large due to this. With only the first Error log line I have more than enough information to track what a problem is. :)

Does anyone have an idea how to do this?

0 likes
5 replies
bashy's avatar

Disable logging and manage errors manually in exception parts?

hsl's avatar
Level 2

Thanks! Do you have any idea where I can disable the logging? In config/app.php I only see the options daily, single, syslog and errorlog.

hsl's avatar
Level 2

Thanks, I've now added this: Log::error( '['.$e->getCode().'] "'.$e->getMessage().'" on line '.$e->getTrace()[0]['line'].' of file '.$e->getTrace()[0]['file']);

It's almost how I want it,..

In the webinterface it shows 1/1 and the type of Exception, in my case it's mostly a CurlException from one of the packages I'm using. In $e I can't find the Exception type, any idea where I can find it?

1 like

Please or to participate in this conversation.