Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs issued by connection.js don't use key-value pairs #2921

Closed
mfogel opened this issue Feb 4, 2021 · 2 comments · Fixed by #2922
Closed

Logs issued by connection.js don't use key-value pairs #2921

mfogel opened this issue Feb 4, 2021 · 2 comments · Fixed by #2922

Comments

@mfogel
Copy link
Contributor

mfogel commented Feb 4, 2021

Summary

Some of the logs issued from connection.js don't make use of logging key-value pairs. Instead they stringify their data into their message. This makes them harder to parse them later on.

Steps To Reproduce

Use a default log.ini

[main]
level=info
timestamps=false
format=default

Then set up a client to drop a connection, which will trigger this call to loginfo: https://github.com/haraka/Haraka/blob/2.8.27/connection.js#L173

Expected behavior

The following gets logged:

[INFO] [C042AE7D-8968-4F9B-B7F2-4BA94D65F430] [core] client half closed connection ip=10.0.1.213

Actual behavior

The following gets logged:

[INFO] [C042AE7D-8968-4F9B-B7F2-4BA94D65F430] [core] client [10.0.1.213] half closed connection

System Info:

Haraka Haraka.js — Version: 2.8.27
Node v12.20.1
OS Linux ip-10-0-1-69.ec2.internal 4.14.214-160.339.amzn2.aarch64 #1 SMP Sun Jan 10 05:53:19 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
openssl OpenSSL 1.0.2k-fips 26 Jan 2017
@mfogel
Copy link
Contributor Author

mfogel commented Feb 4, 2021

I can prepare a PR to implement this logging behavior change for these calls in connection.js if it's something the core dev team is open to. Cheers.

@msimerson
Copy link
Member

Sounds like a log line was missed in #2047. A PR to update it/them is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants