Generate syslog tags based on the name of the executable or link. #362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running multiple NATS servers on a machine and directing output to syslog, we need a way to differentiate the servers beyond process ID. One way to do this is to use the link or executable name used to launch the process. Users can then identify individual servers in the syslog output if they link to, or copy the NATS server. Current behavior will be maintained when using the default NATS server executable.
Given files
gnatsd
, a copy ofgnatsd
(gnatsd.1
) and a linkgnatsd-link
:The NATS server will generate syslog statements based on the link or executable name stripped of the path, demonstrated below. The command used is paired with a corresponding syslog statement.
# ../tmp/gnatsd -s udp://localhost:512
Oct 18 11:50:15 machinename gnatsd[92147] <Notice>: Starting nats-server version 0.9.4
# ./gnatsd.1 -s udp://localhost:512
Oct 18 11:50:38 machinename gnatsd.1[92173] <Notice>: Starting nats-server version 0.9.4
# ./gnatsd-link -s udp://localhost:512
Oct 18 11:51:28 machinename gnatsd-link[92188] <Notice>: Starting nats-server version 0.9.4
# gnatsd -s udp://localhost:512
Oct 18 11:52:26 machinename gnatsd[92296] <Notice>: Starting nats-server version 0.9.4
Note: An alternative is a command line parameter / server option.