1 Logging library with MDC support
2 ================================
4 A Golang implementation of a structured logging library with Mapped Diagnostics Context (MDC) support.
11 A new logger instance is created with InitLogger function. Process identity is given as a parameter.
13 ### Mapped Diagnostics Context
15 The MDCs are key-value pairs, which are included to all log entries by the library.
16 The MDC pairs are logger instance specific.
20 Each log entry written the library contains
25 * MDC pairs of the logger instance
28 Currently the library only supports JSON formatted output written to standard out of the process
32 `{"ts":1551183682974,"crit":"INFO","id":"myprog","mdc":{"second key":"other value","mykey":"keyval"},"msg":"hello world!"}`
41 mdcloggo "gerrit.o-ran-sc.org/r/com/golog"
45 logger, _ := mdcloggo.InitLogger("myname")
46 logger.MdcAdd("mykey", "keyval")
47 logger.Info("Some test logs")
53 Copyright (c) 2019 AT&T Intellectual Property.
54 Copyright (c) 2018-2019 Nokia.
56 Licensed under the Apache License, Version 2.0 (the "License");
57 you may not use this file except in compliance with the License.
58 You may obtain a copy of the License at
60 http://www.apache.org/licenses/LICENSE-2.0
62 Unless required by applicable law or agreed to in writing, software
63 distributed under the License is distributed on an "AS IS" BASIS,
64 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
65 See the License for the specific language governing permissions and
66 limitations under the License.
71 The Dockerfile in the `ci` directory _only_ runs, when build, the unit tests for the repository.