You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`SW_AGENT_LOG_IGNORE_FILTER`| This config customizes whether to ignore the application-defined logger filters, if `True`, all logs are reported disregarding any filter rules. |`False`|
39
39
|`SW_AGENT_LOG_REPORTER_FORMATTED`| If `True`, the log reporter will transmit the logs as formatted. Otherwise, puts logRecord.msg and logRecord.args into message content and tags(`argument.n`), respectively. Along with an `exception` tag if an exception was raised. |`True`|
40
40
|`SW_AGENT_LOG_REPORTER_LAYOUT`| The log reporter formats the logRecord message based on the layout given. |`%(asctime)s [%(threadName)s] %(levelname)s %(name)s - %(message)s`|
41
+
|`SW_AGENT_CAUSE_EXCEPTION_DEPTH`| This config limits agent to report up to `limit` stacktrace, please refer to [Python traceback](https://docs.python.org/3/library/traceback.html#traceback.print_tb) for more explanations. |`5`|
`log_grpc_reporter_active=True` - Enables the log reporter.
16
+
`log_reporter_active=True` - Enables the log reporter.
17
17
18
-
`log_grpc_reporter_max_buffer_size` - The maximum queue backlog size for sending log data to backend, logs beyond this are silently dropped.
18
+
`log_reporter_max_buffer_size` - The maximum queue backlog size for sending log data to backend, logs beyond this are silently dropped.
19
19
20
20
Alternatively, you can pass configurations through environment variables.
21
21
Please refer to [EnvVars.md](EnvVars.md) for the list of environment variables associated with the log reporter.
@@ -24,7 +24,7 @@ Please refer to [EnvVars.md](EnvVars.md) for the list of environment variables a
24
24
Only the logs with a level equal to or higher than the specified will be collected and reported.
25
25
In other words, the agent ignores some unwanted logs based on your level threshold.
26
26
27
-
`log_grpc_reporter_level` - The string name of a logger level.
27
+
`log_reporter_level` - The string name of a logger level.
28
28
29
29
Note that it also works with your custom logger levels, simply specify its string name in the config.
30
30
@@ -40,7 +40,7 @@ class AppFilter(logging.Filter):
40
40
41
41
logger.addFilter(AppFilter())
42
42
```
43
-
However, if you do would like to report those filtered logs, set the `log_grpc_reporter_ignore_filter` to `True`.
43
+
However, if you do would like to report those filtered logs, set the `log_reporter_ignore_filter` to `True`.
44
44
45
45
46
46
## Formatting
@@ -51,20 +51,27 @@ Note that regardless of the formatting, Python agent will always report the foll
51
51
`logger` - the logger name
52
52
53
53
`thread` - the thread name
54
+
55
+
### Limit stacktrace depth
56
+
You can set the `cause_exception_depth` config entry to a desired level(defaults to 5), which limits the output depth of exception stacktrace in reporting.
57
+
58
+
This config limits agent to report up to `limit` stacktrace, please refer to [Python traceback](https://docs.python.org/3/library/traceback.html#traceback.print_tb) for more explanations.
59
+
54
60
### Customize the reported log format
55
61
You can choose to report collected logs in a custom layout.
56
62
57
-
If not set, the agent uses the layout below by default, else the agent uses your custom layout set in `log_grpc_reporter_layout`.
63
+
If not set, the agent uses the layout below by default, else the agent uses your custom layout set in `log_reporter_layout`.
If the layout is set to `None`, the reported log content will only contain the pre-formatted `LogRecord.message`(`msg % args`) without any additional styles, information or extra fields.
67
+
If the layout is set to `None`, the reported log content will only contain
68
+
the pre-formatted `LogRecord.message`(`msg % args`) without any additional styles or extra fields, stacktrace will be attached if an exception was raised.
62
69
63
70
### Transmit un-formatted logs
64
71
You can also choose to report the log messages without any formatting.
65
72
It separates the raw log msg `logRecord.msg` and `logRecord.args`, then puts them into message content and tags starting from `argument.0`, respectively, along with an `exception` tag if an exception was raised.
66
73
67
-
Note when you set `log_grpc_reporter_formatted` to False, it ignores your custom layout introduced above.
74
+
Note when you set `log_reporter_formatted` to False, it ignores your custom layout introduced above.
0 commit comments