summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com>2021-11-18 09:55:03 -0800
committerGitHub <noreply@github.com>2021-11-18 09:55:03 -0800
commit241bb5aad07835fad92bcfcd706519f0ff712f34 (patch)
tree34dffe8b9c3589aeda8033734165ac27e07f2ff1
parent4e50dffc9f45b849d407f99b0c4fe70ff32abd76 (diff)
parent0b66280b73ed0bf7b6394bc40c6cfc6c082045ae (diff)
Merge pull request #6196 from CatherineF-dev/patch-1
Add logging header formats in doc
-rw-r--r--contributors/devel/sig-instrumentation/logging.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/contributors/devel/sig-instrumentation/logging.md b/contributors/devel/sig-instrumentation/logging.md
index 4fcdfe73..9ae2aaab 100644
--- a/contributors/devel/sig-instrumentation/logging.md
+++ b/contributors/devel/sig-instrumentation/logging.md
@@ -38,3 +38,25 @@ Logs generated by `ErrorS` command may be enhanced with additional debug informa
As per the comments, the practical default level is V(2). Developers and QE
environments may wish to run at V(3) or V(4). If you wish to change the log
level, you can pass in `-v=X` where X is the desired maximum level to log.
+
+## Logging header formats
+
+An example logging message is
+```
+I0528 19:15:22.737538 47512 logtest.go:52] msg...
+```
+
+This log line have this form:
+```
+ Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg...
+where the fields are defined as follows:
+ L A single character, representing the log level (eg 'I' for INFO)
+ mm The month (zero padded; ie May is '05')
+ dd The day (zero padded)
+ hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds
+ threadid The space-padded thread ID as returned by GetTID()
+ file The file name
+ line The line number
+ msg The user-supplied message
+```
+See more in [here](https://github.com/kubernetes/klog/blob/9ad246211af1ed84621ee94a26fcce0038b69cd1/klog.go#L581-L597)