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

Use syslog to capture the build log #270

Merged
merged 1 commit into from
Nov 16, 2015
Merged

Conversation

jawher
Copy link
Contributor

@jawher jawher commented Oct 11, 2015

Replaces the old way of capturing logs (stream docker logs to a pipe with a scanner on the reader to write to mongo) with a new one based on docker's syslog logging driver.

  • The server listens for TCP connections on port 3001
  • Build containers are started configured to stream their logs to that endpoint (tcp:https://server:3001) using the syslog driver and format
  • The server parses and stores the logs in mongo

For this feature to work, the server needs to know its address, so that when it starts an orchestration container, it can configure it with the syslog endpoint.
This is set in the BZK_SYSLOG_URL in the server.
The CLI was modified to set that variable from the --syslog-uri flag (which has a default value of $BZK_SYSLOG_URL in the host).
For example:

bzk service start --syslog-uri="tcp:https://$(docker-machine ip main):3001"

@jawher
Copy link
Contributor Author

jawher commented Oct 12, 2015

BTW, I'm not very happy with the --syslog-uri flag: to start the server, we need to pass to it its uri (host and port). This will make the server incompatible stuff like docker run -P or any other auto port mapping.

However, since this is just an intermediary step toward separating the concrete build part in a separate component (See #260), this problem will be solved in the next iteration, where this server uri will be passed to the worker component instead of the server.

@julienvey
Copy link
Member

👍

@jawher jawher force-pushed the use-syslog-to-capture-build-logs branch from dde4383 to 44477d1 Compare October 12, 2015 20:12
@jawher jawher force-pushed the use-syslog-to-capture-build-logs branch from 44477d1 to 05248a0 Compare November 15, 2015 20:54
@jawher jawher force-pushed the use-syslog-to-capture-build-logs branch from 05248a0 to 8c22c16 Compare November 15, 2015 21:38
jawher added a commit that referenced this pull request Nov 16, 2015
@jawher jawher merged commit c478d8f into master Nov 16, 2015
@jawher jawher deleted the use-syslog-to-capture-build-logs branch November 16, 2015 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants