Skip to content

Commit 241bb5a

Browse files
authored
Merge pull request #6196 from CatherineF-dev/patch-1
Add logging header formats in doc
2 parents 4e50dff + 0b66280 commit 241bb5a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

contributors/devel/sig-instrumentation/logging.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,25 @@ Logs generated by `ErrorS` command may be enhanced with additional debug informa
3838
As per the comments, the practical default level is V(2). Developers and QE
3939
environments may wish to run at V(3) or V(4). If you wish to change the log
4040
level, you can pass in `-v=X` where X is the desired maximum level to log.
41+
42+
## Logging header formats
43+
44+
An example logging message is
45+
```
46+
I0528 19:15:22.737538 47512 logtest.go:52] msg...
47+
```
48+
49+
This log line have this form:
50+
```
51+
Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg...
52+
where the fields are defined as follows:
53+
L A single character, representing the log level (eg 'I' for INFO)
54+
mm The month (zero padded; ie May is '05')
55+
dd The day (zero padded)
56+
hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds
57+
threadid The space-padded thread ID as returned by GetTID()
58+
file The file name
59+
line The line number
60+
msg The user-supplied message
61+
```
62+
See more in [here](https://github.com/kubernetes/klog/blob/9ad246211af1ed84621ee94a26fcce0038b69cd1/klog.go#L581-L597)

0 commit comments

Comments
 (0)