Merge lp:~cprov/core-image-watcher/logstash into lp:core-image-watcher

Proposed by Celso Providelo
Status: Merged
Approved by: Celso Providelo
Approved revision: no longer in the source branch.
Merged at revision: 8
Proposed branch: lp:~cprov/core-image-watcher/logstash
Merge into: lp:core-image-watcher
Diff against target: 64 lines (+25/-0)
4 files modified
README.rst (+7/-0)
core-service.conf (+6/-0)
core_image_watcher/__init__.py (+11/-0)
requirements.txt (+1/-0)
To merge this branch: bzr merge lp:~cprov/core-image-watcher/logstash
Reviewer Review Type Date Requested Status
Para Siva (community) Approve
Review via email: mp+254395@code.launchpad.net

Commit message

Adding logstash logging support.

Description of the change

Adding logstash logging support.

I am only doing this because I want to play with CI/CD, really ...

To post a comment you must log in.
Revision history for this message
Para Siva (psivaa) wrote :

Thanks for the doc and the example config. +1.

review: Approve
8. By Celso Providelo

Adding logstash logging support. [r=Parameswaran Sivatharman]

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.rst'
2--- README.rst 2015-03-26 17:55:33 +0000
3+++ README.rst 2015-03-27 14:01:01 +0000
4@@ -66,3 +66,10 @@
5 device = generic_amd64
6 location = /tmp/latest-core-image-version
7 poll_period = 60
8+
9+ [logstash]
10+ host = 127.0.0.1
11+ port = 5959
12+ version = 1
13+
14+`logstash` section is optional.
15
16=== modified file 'core-service.conf'
17--- core-service.conf 2015-03-26 12:58:33 +0000
18+++ core-service.conf 2015-03-27 14:01:01 +0000
19@@ -8,3 +8,9 @@
20 device = generic_amd64
21 location = /tmp/latest-core-image-version
22 poll_period = 60
23+
24+[logstash]
25+host = 127.0.0.1
26+port = 5959
27+version = 1
28+
29
30=== modified file 'core_image_watcher/__init__.py'
31--- core_image_watcher/__init__.py 2015-03-27 04:20:18 +0000
32+++ core_image_watcher/__init__.py 2015-03-27 14:01:01 +0000
33@@ -26,6 +26,8 @@
34 import time
35
36 import kombu
37+import logstash
38+
39
40 logger = logging.getLogger(__name__)
41
42@@ -147,6 +149,15 @@
43 )
44 root_logger.addHandler(handler)
45
46+ if 'logstash' in config:
47+ root_logger.addHandler(
48+ logstash.LogstashHandler(
49+ config['logstash']['host'],
50+ int(config['logstash']['port']),
51+ int(config['logstash']['version'])
52+ )
53+ )
54+
55
56 def main():
57 parser = argparse.ArgumentParser(
58
59=== modified file 'requirements.txt'
60--- requirements.txt 2015-03-25 13:52:28 +0000
61+++ requirements.txt 2015-03-27 14:01:01 +0000
62@@ -1,1 +1,2 @@
63 kombu==3.0.24
64+python-logstash==0.4.2

Subscribers

People subscribed via source and target branches