voxpupuli / puppet-elasticsearch

Elasticsearch Puppet module
Apache License 2.0
404 stars 478 forks source link

log4j config, how to add custom appender #529

Open bilsch opened 8 years ago

bilsch commented 8 years ago

We are looking to add a modification to the log4j appender type used to get the rolling file appender vs the daily rolling file appender.

http://grokbase.com/t/gg/elasticsearch/14chrn08rj/pruning-logs-how-to-get-maxbackupindex-to-work

From what I see in the template the only change we can make is to alter the already-configured appender. Is that right?

Is there a way to inject a modified appender via hiera? I'm not sure if this is the right yml structure for hieradata but this is what I came up with to try out/test:

    logging_config:
      rollingFile:
        file:
          type: rollingFile
          file: "${path.logs}/${cluster.name}.log"
          maxBackupIndex: 10
          layout:
            type: pattern
            conversionPattern: '"[%d{ISO8601}][%-5p][%-25c] %m%n"'

Not sure if the nested yml structure is the right way to go. The elasticsearch.yml renders something like file.type: rollingFile instead

electrical commented 8 years ago

Hi,

The logging file is something that i still want to improve but haven't had the time yet. This use case will certainly help me with thinking up improvements for it. more idea's / PR's are always welcome :-)