Skip to content

Commit 34ac992

Browse files
Anton KucherovAlekSi
authored andcommitted
PMM-4154 Add log-levels. (#143)
1 parent b090789 commit 34ac992

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Added
1212
- Added Authentification Database option when connect to mongo #139, thx [@etiennecoutaud](https://github.com/etiennecoutaud).
1313
- Added helm chart to readme #140, thx [@pgdagenais](https://github.com/pgdagenais).
14+
- [PMM-4154](https://jira.percona.com/browse/PMM-4154): Added standard logging flags.
1415

1516
### Fixed
1617
- Fixed some function comments based on best practices from Effective Go #137, thx [@CodeLingoBot](https://github.com/CodeLingoBot).

mongodb_exporter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ var (
7878

7979
func main() {
8080
initVersionInfo()
81+
log.AddFlags(kingpin.CommandLine)
8182
kingpin.Parse()
8283

8384
if *testF {

testdata/mongodb_exporter.testFlagHelp.golden

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,11 @@ Flags:
5656
Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'.
5757
--groups.enabled="" Currently ignored
5858
--version Show application version.
59+
--log.level="info" Only log messages with the given severity or
60+
above. Valid levels: [debug, info, warn, error,
61+
fatal]
62+
--log.format="logger:stderr"
63+
Set the log target and format. Example:
64+
"logger:syslog?appname=bob&local=7" or
65+
"logger:stdout?json=true"
5966

0 commit comments

Comments
 (0)