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

Fix handling of default/empty log level #3

Closed
wants to merge 1 commit into from
Closed

Fix handling of default/empty log level #3

wants to merge 1 commit into from

Conversation

dcarley
Copy link

@dcarley dcarley commented Nov 6, 2012

Set $verbose to an empty string if no acceptable log level was passed. Then
unquote the resulting string in the exec command so that it can expand to
nothing. The contents are already sanitised so we shouldn't need to worry
about quoting any value.

Added examples of the three "known" logging levels that are parsed.

With the default configuration of LOGSTASH_LOGLEVEL=warn the wrapper
script was not setting the $verbose variable. The resulting command then
featured a pair of quotes with no contents inside: ""

The logstash JAR rejected this with:

No such command ""
Available commands:
  -v
  -V
  --version
  agent
  web
  test
  irb
  pry

Set $verbose to an empty string if no acceptable log level was passed. Then
unquote the resulting string in the exec command so that it can expand to
nothing. The contents are already sanitised so we shouldn't need to worry
about quoting any value.

Added examples of the three "known" logging levels that are parsed.

With the default configuration of `LOGSTASH_LOGLEVEL=warn` the wrapper
script was not setting the $verbose variable. The resulting command then
featured a pair of quotes with no contents inside: `""`

The logstash JAR rejected this with:
```
No such command ""
Available commands:
  -v
  -V
  --version
  agent
  web
  test
  irb
  pry
```
@dcarley dcarley closed this Dec 6, 2021
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 this pull request may close these issues.

1 participant