Skip to content
/ perflog Public

Structured logging support for application performance and monitoring data

License

Notifications You must be signed in to change notification settings

cjrh/perflog

Repository files navigation

https://travis-ci.org/cjrh/perflog.svg?branch=master https://coveralls.io/repos/github/cjrh/perflog/badge.svg?branch=master

perflog

Structured logging support for application performance and monitoring data

Demo

""" My Application """

import perflog

def main():
    <All the usual application code goes here>


if __name__ == '__main__':
    perflog.set_and_forget()
    main()

There are several parameters for the set_and_forget method that can be used to change the default behaviour. For example, by default the performance log messages will be written every 60 seconds.

Note: in addition to writing performance data to the log message itself, perflog also adds extra logrecord fields. This means that if you're using a log formatter that writes out all the fields in some kind of structured format (say, logstash_formatter), you will find that the performance data will also be recorded in those fields and can therefore be accessed in tools like Kibana.

Acknowledgements

perflog uses psutil to obtain all the process-related information. Thanks Giampaolo!

About

Structured logging support for application performance and monitoring data

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages