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

'log' resource ignores the 'message' attribute, and will always use the name of the resource as the message #14253

Open
mromero-convoso opened this issue Feb 22, 2024 · 0 comments
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@mromero-convoso
Copy link

mromero-convoso commented Feb 22, 2024

Description

The 'log' resource, when used in a recipe, ignores the 'message' attribute and instead will use whatever the name of the log resource is as its message.

The following will always spit out "message"

log 'message' do
  message 'This is the message that should be added to the log.'
  level :info
end

I discovered this while trying to do something with lazy evaluation:

log 'dummy message' do  # ignores the 'message' value and always spits out 'dummy message'
  message lazy { node.run_state[:dump_master_log_file] }
end

Chef Version

18.4.2

Platform Version

Ubuntu 20.04 LTS

Replication Case

The most minimal example I can think of would be:

log 'dummy message' do
  message 'this is a much better message'
end

Expected output should be 'this is a much better message'

Client Output

log[dummy message] action write

Stacktrace

N/A

@mromero-convoso mromero-convoso added the Status: Untriaged An issue that has yet to be triaged. label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant