kemra102 / puppet-cloudwatchlogs

Puppet module for configuring AWS Cloudwatch Logs on Amazon Linux, Ubuntu, Red Hat & CentOS EC2 instances.
BSD 2-Clause "Simplified" License
11 stars 36 forks source link

How do I specify the log group? #9

Closed asieira closed 9 years ago

asieira commented 9 years ago

I see on the documentation that the streamname parameter can be used to specify the stream name to use. But how do I specify the log group name?

kemra102 commented 9 years ago

Currently the log_group_name is to the same name as the resource name itself, e.g. if you have:

cloudwatchlogs::log { 'Messages':
  path => '/var/log/messages',
}

then the log_group_name will be set to Messages.

Unless there is a reason you might want to make this separately configurable I think the best course would be for me to update the docs to reflect this information.

asieira commented 9 years ago

Ok, that is a very sane default. However, not everyone will necessarily want to conform to that standard.

For example, unless I understand this incorrectly, the way the module currently works would prevent me from sending two different log files to the same Log Group, correct?

kemra102 commented 9 years ago

That is correct

asieira commented 9 years ago

So I would consider this a valid reason for having the Log Group separately configurable. :)

Do you agree?

kemra102 commented 9 years ago

Not something I would use but if you might have a use for it I'm happy to code it in. Just let me know if it's a feature you want and I'll take appropriate action.

asieira commented 9 years ago

I do, actually.

My application uses spot instances and creates and destroys instances rather frequently, so having the default structure (Log Group = log file, Log Stream = instance ID) doesn't work that well. Instead, I'll add the instance ID to the log content itself in my application, and I'll use the Log Group and Log Streams for other classifications that better suit my needs.

Thank you very much for the wonderful module and the willingness to add this new feature! :+1:

kemra102 commented 9 years ago

Latest release on the Forge includes the requested change. Any problems with it just log a new issue, many thanks.

asieira commented 9 years ago

:bow: