seninel部署
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Sentinel Logging Extension SLF4J
  2. To integrate logs of sentinel into your project which uses slf4j for bridge of logging you can
  3. simply introduce following dependency to your project:
  4. ```xml
  5. <dependency>
  6. <groupId>com.alibaba.csp</groupId>
  7. <artifactId>sentinel-logging-slf4j</artifactId>
  8. <version>${sentinel.version}</version>
  9. </dependency>
  10. ```
  11. And if you want to control level of logging special for sentinel the loggers that sentinel uses
  12. are called `sentinelRecordLogger` and `sentinelCommandCenterLogger`. For example in XML configration
  13. coming with log4j2 implementation:
  14. ```xml
  15. <?xml version="1.0" encoding="UTF-8" ?>
  16. <Configuration>
  17. <Appenders>
  18. <Console name="Console" target="SYSTEM_OUT">
  19. <PatternLayout pattern="%-5level %logger - %msg%n"/>
  20. </Console>
  21. <File name="FILE" fileName="sentinel-record.log" append="false">
  22. <PatternLayout pattern="%-5level %logger - %msg%n"/>
  23. </File>
  24. <File name="FILE2" fileName="sentinel-command-center.log" append="false">
  25. <PatternLayout pattern="%-5level %logger - %msg%n"/>
  26. </File>
  27. </Appenders>
  28. <Loggers>
  29. <Root level="info"/>
  30. <logger name="sentinelRecordLogger" level="trace">
  31. <appender-ref ref="Console" />
  32. <appender-ref ref="FILE" />
  33. </logger>
  34. <logger name="sentinelCommandCenterLogger" level="trace">
  35. <appender-ref ref="Console" />
  36. <appender-ref ref="FILE2" />
  37. </logger>
  38. </Loggers>
  39. </Configuration>
  40. ```