启动日志如下:
hello world
encoder: 1
sampling: 1
multiprocessing: 1
heartbeat: 0
Writing log to file /data/applogs/cat/cat_2022_04_08.log.
File: "/tmp/ccat/src/lib/cat_clog.c", Line 103, in CLogInit
2022-04-08 20:03:24 [42844][[INFO] ] Cat log module has been successfully initialized.
File: "/tmp/ccat/src/ccat/client_config.c", Line 127, in initCatClientConfig
2022-04-08 20:03:24 [42844][[INFO] ] Current hostname: hadoop163
File: "/tmp/ccat/src/ccat/message_manager.c", Line 83, in initMessageManager
2022-04-08 20:03:24 [42844][[INFO] ] Current ip: 192.168.0.163
File: "/tmp/ccat/src/ccat/message_manager.c", Line 94, in initMessageManager
2022-04-08 20:03:24 [42844][[INFO] ] Current ip hex: c0a857a3
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 205, in getRouterFromServer
2022-04-08 20:03:24 [42844][[INFO] ] Start connect to router server 192.168.0.162 : 8000.
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 221, in getRouterFromServer
2022-04-08 20:03:24 [42844][[INFO] ] Connect to router server 192.168.0.162 : 8000 Success.
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 262, in getRouterFromServer
2022-04-08 20:03:24 [42844][[INFO] ] Got available server list:
<!doctype html>HTTP Status 400 – Bad Request
HTTP Status 400 – Bad Request
Type Exception Report
Message The HTTP header line [host 192.168.0.162] does not conform to RFC 7230 and has been ignored.
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Exception
java.lang.IllegalArgumentException: The HTTP header line [host 192.168.0.162] does not conform to RFC 7230 and has been ignored.
org.apache.coyote.
File: "/tmp/ccat/src/ccat/router_json_parser.c", Line 137, in parseCatJsonRouter
2022-04-08 20:03:24 [42844][[WARNING] ] CatRouter Json Parser Error before: [<!doctype html>HTTP Status 400 – Bad Request
HTTP Status 400 – Bad Request
Type Exception Report
Message The HTTP header line [host 192.168.0.162] does not conform to RFC 7230 and has been ignored.
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Exception
java.lang.IllegalArgumentException: The HTTP header line [host 192.168.0.162] does not conform to RFC 7230 and has been ignored.
org.apac
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 30, in updateCatServerConn
2022-04-08 20:03:24 [42844][[DEBUG] ] Get router from server successfully
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 394, in updateCatServerConn
2022-04-08 20:03:24 [42844][[DEBUG] ] Trying connecting to the best server
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 60, in tryConnBestServer
2022-04-08 20:03:24 [42844][[INFO] ] Try connect to server 127.0.0.1:2280.
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 88, in tryConnBestServer
2022-04-08 20:03:24 [42844][[WARNING] ] Cannot connect to server 127.0.0.1:2280.
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 60, in tryConnBestServer
2022-04-08 20:03:24 [42844][[INFO] ] Try connect to server 127.0.0.1:2280.
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 88, in tryConnBestServer
2022-04-08 20:03:24 [42844][[WARNING] ] Cannot connect to server 127.0.0.1:2280.
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 60, in tryConnBestServer
2022-04-08 20:03:24 [42844][[INFO] ] Try connect to server 127.0.0.1:2280.
File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 88, in tryConnBestServer
2022-04-08 20:03:24 [42844][[WARNING] ] Cannot connect to server 127.0.0.1:2280.
File: "/tmp/ccat/src/ccat/client.c", Line 0, in catClientInitInner
2022-04-08 20:03:24 [42844][[ERROR] ] Failed to initialize cat: Error occurred while getting router config from remote server.
File: "/tmp/ccat/src/ccat/client.c", Line 140, in catClientInitWithConfig
2022-04-08 20:03:24 [42844][[INFO] ] Cat has been initialized with appkey: my-xx-appkey
try
fin
版本:python 3.6
源代码如下: cat_test.py
!/usr/bin/python
import cat import time
print("hello world")
cat.init("my-xx-appkey",debug=True)
with cat.Transaction("foo", "bar") as t: try: print("try") t.add_data("a=1") cat.log_event("hook", "before")
do something
time.sleep(1)
启动日志如下: hello world encoder: 1 sampling: 1 multiprocessing: 1 heartbeat: 0 Writing log to file /data/applogs/cat/cat_2022_04_08.log. File: "/tmp/ccat/src/lib/cat_clog.c", Line 103, in CLogInit 2022-04-08 20:03:24 [42844][[INFO] ] Cat log module has been successfully initialized. File: "/tmp/ccat/src/ccat/client_config.c", Line 127, in initCatClientConfig 2022-04-08 20:03:24 [42844][[INFO] ] Current hostname: hadoop163 File: "/tmp/ccat/src/ccat/message_manager.c", Line 83, in initMessageManager 2022-04-08 20:03:24 [42844][[INFO] ] Current ip: 192.168.0.163 File: "/tmp/ccat/src/ccat/message_manager.c", Line 94, in initMessageManager 2022-04-08 20:03:24 [42844][[INFO] ] Current ip hex: c0a857a3 File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 205, in getRouterFromServer 2022-04-08 20:03:24 [42844][[INFO] ] Start connect to router server 192.168.0.162 : 8000. File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 221, in getRouterFromServer 2022-04-08 20:03:24 [42844][[INFO] ] Connect to router server 192.168.0.162 : 8000 Success. File: "/tmp/ccat/src/ccat/server_connection_manager.c", Line 262, in getRouterFromServer 2022-04-08 20:03:24 [42844][[INFO] ] Got available server list: <!doctype html>HTTP Status 400 – Bad Request
HTTP Status 400 – Bad Request
Type Exception Report
Message The HTTP header line [host 192.168.0.162] does not conform to RFC 7230 and has been ignored.
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Exception