You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like glog logs to three different files, viz., name.INFO, name.WARNING, name.ERROR (where INFO also contains logs of higher priority (Warn and Error) as well, similarly for .WARNING and .ERROR), is it possible to do the same with zap? I now I can achieve the same behaviour by running three different loggers each set with their own atomic level but just asking if there is some straight forward way.
The text was updated successfully, but these errors were encountered:
You can implement a custom zapcore.Core that will multiplex writes to different log levels to different files. A "core" is a backend, and can represent a single file.
As an example, you may want to look at zapcore.NewTee which will log everything to multiple cores. Instead of duplicating the write to all cores, you should check the level of the entry, and determine the appropriate core to write to.
Like glog logs to three different files, viz., name.INFO, name.WARNING, name.ERROR (where INFO also contains logs of higher priority (Warn and Error) as well, similarly for .WARNING and .ERROR), is it possible to do the same with zap? I now I can achieve the same behaviour by running three different loggers each set with their own atomic level but just asking if there is some straight forward way.
The text was updated successfully, but these errors were encountered: