Hi,

can u plz share the implementation for the above?

1.  how to use the "markerName"  in the filter MetricsMarkerFilter.
2. how to create the MetricsFileAppenderFactory with  custom type 
"metricsfile".

plz help, I will be thankful to u

On Thursday, February 12, 2015 at 8:48:24 PM UTC+5:30, Sathish V wrote:
>
> Thanks for your reply, I appreciate it.
>
> Yeah, I was able to implement this.
>
> Here is how I did it,
>
> 1. Configured metrics in YML file to log as below. However the logs were 
> coming in the main log file of the application along with other logs. I 
> wanted to have the metrics in a separate log file.
>     So I added a new markerName as "metrics"
>
> metrics:
>   reporters:
>     - type: log
>       markerName : metrics
>       durationUnit: milliseconds
>       rateUnit: seconds
>       frequency: 20 seconds
>
> 2. Created a new MetricsFileAppenderFactory extending the 
> FileAppenderFactory ( io.dropwizard.logging ) with new custom type 
> "metricsfile"
> 3. Created a new file 
> META-INF/services/io.dropwizard.logging.AppenderFactory  and made the entry 
> of the fully qualified class name of MetricsFileAppenderFactory
> 4. Created a new MetricsMarkerFilter which uses the "markerName" in the 
> YML metrics config to decide to put it in the metrics log file.
> 5. Override the build method of FileAppenderFactory and add the filter to 
> the appender.
> 6.  Added the new entry under logging in YML file
>
>      - type: metricsfile
>       currentLogFilename: ./logs/metrics.log
>       threshold: ALL
>       archive: true
>       archivedLogFilenamePattern: ./logs/metrics-%d.log.gz
>       archivedFileCount: 5
>       timeZone: EST  
> 7. Restart the service
> 8  Bingo!!! See your metrics being logged into the separate log file. You 
> can also set it to be archived with same configuration parameters.
>
> Thanks!!!!  
>
> On Thursday, February 12, 2015 at 7:39:40 AM UTC-5, yx wrote:
>>
>> Sathish,
>>
>> You can use the slf4j reporter:
>>
>> https://dropwizard.github.io/metrics/3.1.0/manual/core/#man-core-reporters-slf4j
>>
>>
>> On Tuesday, February 10, 2015 at 3:36:10 PM UTC-5, Sathish V wrote:
>>>
>>> Hi All,
>>>
>>> How can I send the dropwizard metrics logs type into a separate log file 
>>> ? Is it possible?
>>> Thanks in advance.
>>>
>>> Regards
>>> Sathish
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to