-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix logger in SdJournal, add optional filters and Docker journald tags #16
base: master
Are you sure you want to change the base?
Fix logger in SdJournal, add optional filters and Docker journald tags #16
Conversation
SdJournal was still using the old logger, which has been removed.
Optional journald filters can now be specified in the configuration file. Docker's journald logging driver stores additional fields in the journal (CONTAINER_ID, CONTAINER_NAME, etc.). These fields can now be recorded. Fix possible nil-pointer error in WriteBatch.
IdleFunc() listener was logging too much because lastMetricTime was never updated.
@marcogroppo Would you be able to compile the binary and make it available to download? I'm having some trouble building directly from your fork. |
@toanctruong If you are using Docker you can just |
hey @marcogroppo can you share a working systemd unit that uses the docker container of your fork to send journald logs to cloudwatch? |
@fiunchinho sorry I'm not using it via systemd, I'm using it directly via docker-compose. For example: https://gist.github.com/marcogroppo/cd8b635f4639ccbf4a8f04bf2a98f2ae Please notice that you need to mount /var/log/journal inside the container (like I'm doing in the "volumes" section of the file). Ignore the filters if you just want to send everything; ignore the
|
I extracted the binary like this:
And now have the binary in my current directory:
|
@marcogroppo can this be used to filter by unit name? I.e. if I add something like
then I will only get logs from cron? Thanks! PS: It would be nice to also update the README with the |
@jakubholynet this should work (in theory):
but I have not tested it. The special fields are documented here: |
Thanks a lot, will try it out!
lør. 13. jan. 2018 kl. 10:53 skrev Marco Groppo <[email protected]>:
… @jakubholynet <https://github.com/jakubholynet> this should work (in
theory):
filters = ["_SYSTEMD_UNIT=cron.service"]
but I have not tested it. The special fields are documented here:
https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAmJPueBJeNygu_KNE-AoY4SXxaoxBihks5tKH0OgaJpZM4MjCFA>
.
|
Is there an issue getting this merged? |
@RichardHightower hello, can this be merged and a new version released, please? Thank you! |
poke |
Some fixes and additional features:
SdJournal
was still using the old logger, which has been removed.WriteBatch()
before dereferencing it.IdleFunc()
listener was logging too much becauselastMetricTime
was never updated.CONTAINER_ID
) with each log message. These have been added to theRecord
struct.