@@ -18,28 +18,41 @@ If you're using Logback or Log4J (v1.2 or v2.0) for tracing, you can have your t
18
18
19
19
## Using the Application Insights Java agent
20
20
21
- You can configure the Application Insights Java agent to automatically capture your logs,
22
- by enabling the feature in the ` AI-Agent.xml ` file:
21
+ By default, the Application Insights Java agent automatically captures logging performed at ` WARN ` level and above.
22
+
23
+ You can change the threshold of logging that is captured using the ` AI-Agent.xml ` file:
24
+
25
+ ``` xml
26
+ <?xml version =" 1.0" encoding =" utf-8" ?>
27
+ <ApplicationInsightsAgent >
28
+ <Instrumentation >
29
+ <BuiltIn >
30
+ <Logging threshold =" info" />
31
+ </BuiltIn >
32
+ </Instrumentation >
33
+ </ApplicationInsightsAgent >
34
+ ```
35
+
36
+ You can disable the Java agent's logging capture using the ` AI-Agent.xml ` file:
23
37
24
38
``` xml
25
39
<?xml version =" 1.0" encoding =" utf-8" ?>
26
40
<ApplicationInsightsAgent >
27
41
<Instrumentation >
28
- <BuiltIn enabled = " true " >
29
- <Logging enabled =" true " />
42
+ <BuiltIn >
43
+ <Logging enabled =" false " />
30
44
</BuiltIn >
31
45
</Instrumentation >
32
- <AgentLogger />
33
46
</ApplicationInsightsAgent >
34
47
```
35
48
36
- Alternatively, you can follow the instructions below.
49
+ ## Alternatively (as opposed to using the Java agent) , you can follow the instructions below
37
50
38
- ## Install the Java SDK
51
+ ### Install the Java SDK
39
52
40
53
Follow the instructions to install [ Application Insights SDK for Java] [ java ] , if you haven't already done that.
41
54
42
- ## Add logging libraries to your project
55
+ ### Add logging libraries to your project
43
56
* Choose the appropriate way for your project.*
44
57
45
58
#### If you're using Maven...
@@ -120,7 +133,7 @@ Follow the guidelines to manually install Application Insights Java SDK, downloa
120
133
| Log4j v1.2 | [ Log4J v1.2 appender Jar] ( https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22applicationinsights-logging-log4j1_2%22 ) | applicationinsights-logging-log4j1_2 |
121
134
122
135
123
- ## Add the appender to your logging framework
136
+ ### Add the appender to your logging framework
124
137
To start getting traces, merge the relevant snippet of code to the Log4J or Logback configuration file:
125
138
126
139
* Logback*
0 commit comments