seninel部署
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
tao.zhang 1eee2c80b4
Introduce logging extension: slf4j (#1344)
vor 5 Jahren
..
src Introduce logging extension: slf4j (#1344) vor 5 Jahren
README.md Introduce logging extension: slf4j (#1344) vor 5 Jahren
pom.xml Introduce logging extension: slf4j (#1344) vor 5 Jahren

README.md

Sentinel Logging Extension SLF4J

To use Sentinel Logging Extension SLF4J with Log4j2, you should add the following dependency firstly:

<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-logging-extension-slf4j</artifactId>
    <version>x.y.z</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>${slf4j.version}</version>
</dependency>

If you want to use Slf4j with Log4j2, you can add dependencies of Log4j2 and the binding about Log4j2 and SLF4J. Then you should provide logging configuration as specification of the logging framework. And you can add Sentinel’s Loggers that it name is sentinelRecordLogger or sentinelCommandCenterLogger for your needs. For example:

<?xml version="1.0" encoding="UTF-8" ?>
<Configuration>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%-5level %logger - %msg%n"/>
        </Console>
        <File name="FILE" fileName="sentinel-record.log" append="false">
            <PatternLayout pattern="%-5level %logger - %msg%n"/>
        </File>
        <File name="FILE2" fileName="sentinel-command-center.log" append="false">
            <PatternLayout pattern="%-5level %logger - %msg%n"/>
        </File>
    </Appenders>
    <Loggers>
        <Root level="info"/>
        <logger name="sentinelRecordLogger" level="trace">
            <appender-ref ref="Console" />
            <appender-ref ref="FILE" />
        </logger>
        <logger name="sentinelCommandCenterLogger" level="trace">
            <appender-ref ref="Console" />
            <appender-ref ref="FILE2" />
        </logger>
    </Loggers>
</Configuration>