Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jvmbytes/springboot-logging-aliyun-loghub-starter
springboot logging aliyun loghub starter
https://github.com/jvmbytes/springboot-logging-aliyun-loghub-starter
Last synced: 2 months ago
JSON representation
springboot logging aliyun loghub starter
- Host: GitHub
- URL: https://github.com/jvmbytes/springboot-logging-aliyun-loghub-starter
- Owner: jvmbytes
- License: apache-2.0
- Created: 2018-02-28T07:07:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-28T20:57:31.000Z (about 1 year ago)
- Last Synced: 2024-10-31T17:03:11.512Z (3 months ago)
- Language: Java
- Size: 18.6 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# spring boot logback log to aliyun loghub
**NOT update in time, any pull request is welcome!**
## Usage
**First**, copy the [logback-spring.xml](https://raw.githubusercontent.com/wongoo/springboot-logging-aliyun-loghub-starter/master/src/main/resources/logback-spring.xml)
to your project.
**NOTE: NOT change the file name!**
logback find config file orderly, it will find `logback-spring.xml` first
than `logback.xml`. So your can package and upload this library to repository,
and add maven dependency to overwrite the config `logback.xml` in your project.**Then**, add loghub config:
```
spring.application.name=testloghub.enable=true
loghub.console_output_logback_status=true
loghub.disable_other_appenders=false
loghub.endpoint=http://cn-shenzhen.log.aliyuncs.com
loghub.access_key_id=mykeyid
loghub.access_key=mykey
loghub.project_name=myproject
loghub.log_store=mylogstore
loghub.topic=${spring.application.name}
```NOTE: loghub appender will enable only when `loghub.enable!=false` and `loghub.endpoint` configured.
## Reference:
- aliyun-log-logback-appender, https://github.com/aliyun/aliyun-log-logback-appender