File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,20 @@ def test_custom_fmt(self):
67
67
self .assertTrue ('lineno' in data [0 ][2 ])
68
68
self .assertTrue ('emitted_at' in data [0 ][2 ])
69
69
70
+ def test_json_encoded_message (self ):
71
+ handler = fluent .handler .FluentHandler ('app.follow' , port = self ._port )
72
+
73
+ logging .basicConfig (level = logging .INFO )
74
+ log = logging .getLogger ('fluent.test' )
75
+ handler .setFormatter (fluent .handler .FluentRecordFormatter ())
76
+ log .addHandler (handler )
77
+ log .info ('{"key": "hello world!", "param": "value"}' )
78
+ handler .close ()
79
+
80
+ data = self .get_data ()
81
+ self .assertTrue ('key' in data [0 ][2 ])
82
+ self .assertEqual ('hello world!' , data [0 ][2 ]['key' ])
83
+
70
84
def test_unstructured_message (self ):
71
85
handler = fluent .handler .FluentHandler ('app.follow' , port = self ._port )
72
86
You can’t perform that action at this time.
0 commit comments