-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify logging configuration for Docker #280
Comments
I've had a similar approach. I've separate some useful methods from logger (https://github.com/contributte/logging/blob/master/src/Utils/Utils.php) into Utils, same as you. I've also implemented some loggers, for example ComposedLogger[logger1, ...., loggerN], which accept a multiple loggers and call |
Personally, I would prefer to merge the simplest solution that will enable logging into the stderr (solution A) to the v2.4 than big refactoring of loggers which is a much more complex task and requires a lot of hacks. New logger scheme without hacks would be great for Tracy 3. |
@dg Agree. |
@JanTvrdik @f3l1x Do you want to deal with this? The plan is to release version 3.0, where logging can be solved in a completely different way even with BC breaks. |
Do you want to release 3.0 and after that rewrite logging? |
No. What I'm trying to say is that now is the time. |
I've prepared PR (#556). |
Description
To make Tracy work well with Docker, it needs to log to stdout or stderr. This is currently possible, but not easy to do. In this issue I'd like to discuss how we can make this common use-case easier.
The logger needs to be configured before or during
Tracy::enable()
call, otherwise errors which occur afterTracy::enable()
and beforeTracy::setLogger()
will not be logged to stdout/stderr. Logging of error which occur beforeTracy::enable()
is handled by PHP itself (by configuringerror_log
andlog_errors
php.ini options).Current solution may look like this
This is solution is ugly (we don't use most of Tracy\Logger, only the
formatMessage
method) and way to long to write.Proposed Solution A
Proposed Solution B (my preferred choice)
Note that in both cases, generating bluescreens will be disabled. This is not a problem for me, because after DI container is successfully compiled and initialized, a smarter (and more complex) logger will be used instead which handles this. But maybe other people have different requirements and use-cases so that should be probably considered as well.
The text was updated successfully, but these errors were encountered: