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

Naming convention for logging #205

Closed
mashayev opened this issue Jul 6, 2016 · 4 comments
Closed

Naming convention for logging #205

mashayev opened this issue Jul 6, 2016 · 4 comments

Comments

@mashayev
Copy link

mashayev commented Jul 6, 2016

Hi,

I didn't find any option to change the logs output to different naming convention:
instead of :

Jul 06 14:27:29 "POD" "POD-info": 2016/07/06 11:27:29 - message

to be (for example):

Jul 06 14:27:29 "service" "specific pod info"

@josegonzalez
Copy link
Member

What logging are you talkiing about?

@mashayev
Copy link
Author

mashayev commented Jul 7, 2016

For example:

service (a.k.a nginx) specific pod info (a.k.a worker.{{ index }}) - stdout message.

@mashayev
Copy link
Author

mashayev commented Jul 7, 2016

After sone investigation I figure it out:

In order to make the logs per you naming convention you can use this in your yaml file (or use docker native commands):

yaml example:

        env:
          - name: SYSLOG_TAG
            value: '{{ index .Container.Config.Labels "io.kubernetes.pod.namespace" }}[{{ index .Container.Config.Labels "io.kubernetes.pod.name" }}]'
          - name: SYSLOG_HOSTNAME
            value: '{{ index .Container.Config.Labels "io.kubernetes.container.name" }}'

One thing which is missing is the ENV variables support add env vars on SYSLOG_TAG template.

Hope it will be finished soon.

@josegonzalez
Copy link
Member

Yeah this sounds like not something related to logspout but actually whatever orchestration tool you are using.

Happy you got it resolved.

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

No branches or pull requests

2 participants