|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + ~ Copyright 2024 EPAM Systems |
| 4 | + ~ |
| 5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + ~ you may not use this file except in compliance with the License. |
| 7 | + ~ You may obtain a copy of the License at |
| 8 | + ~ |
| 9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + ~ |
| 11 | + ~ Unless required by applicable law or agreed to in writing, software |
| 12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + ~ See the License for the specific language governing permissions and |
| 15 | + ~ limitations under the License. |
| 16 | + --> |
| 17 | + |
| 18 | +<configuration> |
| 19 | + |
| 20 | + <!-- Send debug messages to System.out --> |
| 21 | + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
| 22 | + <!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder --> |
| 23 | + <encoder> |
| 24 | + <pattern>%d{HH:mm:ss.SSS} %-5level %logger{5} - %thread - %msg%n</pattern> |
| 25 | + </encoder> |
| 26 | + </appender> |
| 27 | + |
| 28 | + <appender name="RP" class="com.epam.reportportal.logback.appender.ReportPortalAppender"> |
| 29 | + <encoder> |
| 30 | + <!--Best practice: don't put time and logging level to the final message. Appender do this for you--> |
| 31 | + <pattern>%d{HH:mm:ss.SSS} [%t] %-5level - %msg%n</pattern> |
| 32 | + <pattern>[%t] - %msg%n</pattern> |
| 33 | + </encoder> |
| 34 | + </appender> |
| 35 | + |
| 36 | + <!-- We turned off framework logging by setting root level="WARN" to avoid logging encoded data into console. By setting level="TRACE" |
| 37 | + for "binary_data_logger" and connected it only to RP appender to log that data to ReportPortal. The 'additivity' flag is important! |
| 38 | + Without it logback will double-log log messages --> |
| 39 | + <logger name="binary_data_logger" level="TRACE" additivity="false"> |
| 40 | + <appender-ref ref="RP"/> |
| 41 | + </logger> |
| 42 | + <logger name="com.epam.reportportal.example" level="TRACE"/> |
| 43 | + |
| 44 | + <!-- By default, the level of the root level is set to DEBUG --> |
| 45 | + <root level="WARN"> |
| 46 | + <appender-ref ref="RP"/> |
| 47 | + <appender-ref ref="STDOUT"/> |
| 48 | + </root> |
| 49 | + |
| 50 | +</configuration> |
0 commit comments