From 24e42d0c10e8c973f61b7437883a370c247cad5f Mon Sep 17 00:00:00 2001 From: CatherineF-dev Date: Mon, 1 Nov 2021 16:40:26 -0400 Subject: Add logging header formats in doc Add link for explaining logging header format `I1025 00:15:15.525108 1 controller_utils.go:116]` --- .../devel/sig-instrumentation/migration-to-structured-logging.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors/devel/sig-instrumentation/migration-to-structured-logging.md b/contributors/devel/sig-instrumentation/migration-to-structured-logging.md index b6c0a18d..dc0d137a 100644 --- a/contributors/devel/sig-instrumentation/migration-to-structured-logging.md +++ b/contributors/devel/sig-instrumentation/migration-to-structured-logging.md @@ -166,6 +166,7 @@ type KMetadata interface { GetNamespace() string } ``` +Logging header formats are in [here](https://github.com/golang/glog/blob/23def4e6c14b4da8ac2ed8007337bc5eb5007998/glog.go#L523-L533) ## Migration -- cgit v1.2.3 From 8bc3ad39a2b19c6c909e0f34f16e70a226228984 Mon Sep 17 00:00:00 2001 From: CatherineF-dev Date: Wed, 3 Nov 2021 14:01:51 +0000 Subject: Update contributors/devel/sig-instrumentation/migration-to-structured-logging.md Co-authored-by: Madhav Jivrajani <12381034+MadhavJivrajani@users.noreply.github.com> --- .../devel/sig-instrumentation/migration-to-structured-logging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributors/devel/sig-instrumentation/migration-to-structured-logging.md b/contributors/devel/sig-instrumentation/migration-to-structured-logging.md index dc0d137a..c402377e 100644 --- a/contributors/devel/sig-instrumentation/migration-to-structured-logging.md +++ b/contributors/devel/sig-instrumentation/migration-to-structured-logging.md @@ -166,7 +166,7 @@ type KMetadata interface { GetNamespace() string } ``` -Logging header formats are in [here](https://github.com/golang/glog/blob/23def4e6c14b4da8ac2ed8007337bc5eb5007998/glog.go#L523-L533) +Logging header formats are in [here](https://github.com/kubernetes/klog/blob/9ad246211af1ed84621ee94a26fcce0038b69cd1/klog.go#L581-L597) ## Migration -- cgit v1.2.3 From e98dcfdbea799e3c7e628f193b9bdd7a11786a7f Mon Sep 17 00:00:00 2001 From: CatherineF-dev Date: Wed, 3 Nov 2021 22:41:16 -0400 Subject: move to logging.md --- contributors/devel/sig-instrumentation/logging.md | 21 +++++++++++++++++++++ .../migration-to-structured-logging.md | 1 - 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/contributors/devel/sig-instrumentation/logging.md b/contributors/devel/sig-instrumentation/logging.md index 4fcdfe73..b8e59a28 100644 --- a/contributors/devel/sig-instrumentation/logging.md +++ b/contributors/devel/sig-instrumentation/logging.md @@ -38,3 +38,24 @@ 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) diff --git a/contributors/devel/sig-instrumentation/migration-to-structured-logging.md b/contributors/devel/sig-instrumentation/migration-to-structured-logging.md index c402377e..b6c0a18d 100644 --- a/contributors/devel/sig-instrumentation/migration-to-structured-logging.md +++ b/contributors/devel/sig-instrumentation/migration-to-structured-logging.md @@ -166,7 +166,6 @@ type KMetadata interface { GetNamespace() string } ``` -Logging header formats are in [here](https://github.com/kubernetes/klog/blob/9ad246211af1ed84621ee94a26fcce0038b69cd1/klog.go#L581-L597) ## Migration -- cgit v1.2.3 From 0b66280b73ed0bf7b6394bc40c6cfc6c082045ae Mon Sep 17 00:00:00 2001 From: CatherineF-dev Date: Wed, 3 Nov 2021 22:43:22 -0400 Subject: Update logging.md --- contributors/devel/sig-instrumentation/logging.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributors/devel/sig-instrumentation/logging.md b/contributors/devel/sig-instrumentation/logging.md index b8e59a28..9ae2aaab 100644 --- a/contributors/devel/sig-instrumentation/logging.md +++ b/contributors/devel/sig-instrumentation/logging.md @@ -47,6 +47,7 @@ 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) @@ -57,5 +58,5 @@ where the fields are defined as follows: 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) -- cgit v1.2.3