Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to clear log files in symfony 2

Tags:

symfony

I was wondering if there is a command to clear the log files in Symfony 2 ? While there is the php app/console cache:clear to clear the cache, I don't know any command to clear the log files (logs/dev.log and logs/prod.log). I have always cleared these logs manually. Thank you

like image 406
tiruncula Avatar asked Sep 18 '14 13:09

tiruncula


1 Answers

There's no explicit command in Symfony. But using a shell one-liner is nothing to be ashamed of:

# straightforward …
echo -n '' > app/logs/dev.log

# … or l33t
> app/logs/dev.log # works at least in bash, haven't tried others
like image 194
lxg Avatar answered Sep 21 '22 03:09

lxg