kimai / kimai

Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more. SaaS version available at https://www.kimai.cloud
https://www.kimai.org
GNU Affero General Public License v3.0
3.01k stars 529 forks source link

Logging to apache log #912

Closed tobybatch closed 5 years ago

tobybatch commented 5 years ago

Is your feature request related to a problem? Please describe. In the docker in particular we run Apache in the attached mode and Apache logs to stdout. Symfony logs are being written to the var/log folder. This will in time bloat the disk as there is no cron to rotate the logs and we need a docker exec command to read the logs.

Describe the solution you'd like Redirect logs to the Apache stdout or stderr. I know this is really a symfony thing but I'm b*gg***d if I can find out how.

Describe alternatives you've considered Mounting /dev/null over the log files but then we loose logging altogether

Additional context not really.

kevinpapst commented 5 years ago

Here is the Monolog config: https://github.com/kevinpapst/kimai2/blob/master/config/packages/prod/monolog.yaml

You should be able to overwrite it in local.yaml but I never tried. Maybe you have to mount (or overwrite it directly with) a new version.

And here is some documentation: https://symfony.com/doc/current/logging.html#how-to-rotate-your-log-files

I guess the default config should be improved ... maybe we can find together a better default and for you something that works smooth in docker?!

And I will start a new documentation after we have something working.

tobybatch commented 5 years ago

Ok, I'll start looking at this when I next cycle into some kimai time. I was being a bit cheeky and just hoping you could say "easy do it like this..." :)

kevinpapst commented 5 years ago

From my understanding ehe idea behind all these log frameworks is actually to prevent logging to generic webserver logs. They fetch all notices, exceptions and stuff and then sent them to configured writers. Syslog is easy, but I am not sure if Apache logs are even possible.

tobybatch commented 5 years ago

Ah, that may be my target then. I can probably get apache to log to syslog and attach that to the std out. Leave it with me.

kevinpapst commented 5 years ago

Fixed?

tobybatch commented 5 years ago

I just figured I's close it as we can't log to apache. If I can attache the syslog to the std out then I'll just add it in the docker. You have enough tickets...

kevinpapst commented 5 years ago

LOL, thats true. But I think docker is important for the project, as it helps to distribute Kimai, so I would always give it a high priority. If you have a working solution, can you send me a link to the GitHub file where I can find it? I might use it for documentation on the website.

tobybatch commented 5 years ago

Thanks, I'll come back it, I'm looking a PR for per-populating tags from the query string on time sheet creation so I can use them to identify git hub issues. It's all part of a chrome extension.

tobybatch commented 5 years ago

Here I guess: https://github.com/kevinpapst/kimai2/blob/master/src/Controller/TimesheetAbstractController.php#L183

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.