简体   繁体   中英

SLF4J and Logback for non java log files

Can use SLF4J+Logback for non java applications log files?
I mean if we have a log file named eg non-java.log can use RollingFileAppender for rotate this file?
Note: imagine non-java.log generated by C/C++ or golang application.
Note: I know we can use syslog (in linux) or other OS utils,but I want to understand logback can do something like syslog.
there is any java library for manage non java log files?
UPDATE:
I working on new Operating system named JOS . (not released yet)
https://github.com/Java-OS
My idea is completely replaces GNU project with Java utilities,
Now i want to understand can manage os logs like dmesg or syslog with java base tools.

Slf4j and logback are written in java and solely for Java (or at least JVM based) languages: They load java classes into JVM, they creat Java objects, manage memory in a sense that java objects do (no explicit descructors, relying on garbage collection) and so on and so forth.

Without java ecosystem (read jvm) its impossible to use these libraries.

The Log rotation is nothing but the code implemented in the relevant appender of the library, namely appender that writes to file. Just to avoid confusions in terms: an appender is like a channel that can handle logs in one concrete way, like write to file, send via socket, print to console, etc.

So if your application that produces the logs runs on top of JVM - no problem using these libraries, otherwise you should either find an appropriate library in your language or choice or roll your own implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM