WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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
| WithFromLevel | level.Warning | Set logging level from which logger should log messages. |
106
-
| WithToLevel | level.Null | Set logging level till which logger should log messages. |
107
-
| WithTemplate | map[string]string {<br/>"timestamp": "%(timestamp)",<br/>"level": "%(level)",<br/>"name": "%(name)",<br/>} | Set template for logging structure. |
108
-
| WithFile | "" | Set file where to log messages, if not set, then logging to file will be disabled. |
109
-
| WithFormat | "json" | Set format for structured logging.<br/><br/>Could be one of the following<br/><ul><li>json</li><li>key-value</li></ul> |
110
-
| WithPretty | false | Set if json message should be pretty printed.<br/>*Option works only with "json" format.*|
111
-
| WithKeyValueDelimiter | "=" | Set key-value delimiter (eg. "key=value", where '=' is the delimiter).<br/>*Option works only with "key-value" format.*|
112
-
| WithPairSeparator | " " | Set key-value separator (eg. "key1=value1,key2=value2", where ',' is the separator).<br/>*Option works only with "key-value" format.*|
113
-
| WithName | "root" | Set logger name. |
114
-
| WithTimeFormat | time.RFC3339 | Set time format for logging message. |
| WithFromLevel | level.Warning | Set logging level from which logger should log messages. |
106
+
| WithToLevel | level.Null | Set logging level till which logger should log messages. |
107
+
| WithTemplate | map[string]string {<br/>"timestamp": "%(timestamp)",<br/>"level": "%(level)",<br/>"name": "%(name)",<br/>} | Set template for logging structure. |
108
+
| WithFile | "" | Set file where to log messages, if not set, then logging to file will be disabled. |
109
+
| WithFormat | "json" | Set format for structured logging.<br/><br/>Could be one of the following<br/><ul><li>json</li><li>key-value</li></ul> |
110
+
| WithPretty | false | Set if json message should be pretty printed.<br/>*Option works only with "json" format.*|
111
+
| WithKeyValueDelimiter | "=" | Set key-value delimiter (eg. "key=value", where '=' is the delimiter).<br/>*Option works only with "key-value" format.*|
112
+
| WithPairSeparator | " " | Set key-value separator (eg. "key1=value1,key2=value2", where ',' is the separator).<br/>*Option works only with "key-value" format.*|
113
+
| WithName | "root" | Set logger name. |
114
+
| WithTimeFormat | time.RFC3339 | Set time format for logging message. |
115
115
116
116
### Custom Logger
117
117
118
118
Alternatively you could create application logger. To do this you would need to create a new logger.
0 commit comments