Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dinstone/loghub
loghub is logging delegate hub
https://github.com/dinstone/loghub
Last synced: about 1 month ago
JSON representation
loghub is logging delegate hub
- Host: GitHub
- URL: https://github.com/dinstone/loghub
- Owner: dinstone
- Created: 2018-11-03T01:17:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-05T12:35:10.000Z (over 2 years ago)
- Last Synced: 2023-07-27T21:41:32.921Z (over 1 year ago)
- Language: Java
- Size: 106 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: license/ApacheLicenseV2.0
Awesome Lists containing this project
README
# What
**Loghub** is a log delegate.# Quick Start
select log implement:
```xml
com.dinstone.loghub
loghub-core
1.3.1
```
or
```xml
com.dinstone.loghub
loghub-slf4j
1.3.1
```# Example
##JUL##```java
@Test
public void test01() throws InterruptedException {
LoggerFactory.getLogger("");JulOption option = new JulOption().setPattern("logs/loghub.log").setLimitDays(3);
JulDelegateFactory factory = new JulDelegateFactory(option);
LoggerFactory.initialise(factory);Logger logger = LoggerFactory.getLogger(LoggerTest.class);
for (int i = 0; i < 5; i++) {
logger.info("case 01 {},{}", i);
}Thread.sleep(1000);
}
```##SLF4j/Log4j/Log4j2##
```java
@Test
public void test00() throws InterruptedException {
Logger logger = LoggerFactory.getLogger(LoggerTest.class);
for (int i = 0; i < 5; i++) {
logger.info("case 00 {},{}", i);
}Thread.sleep(1000);
}
```