Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New syslog writer #156

Open
aerturk opened this issue Jul 18, 2020 · 7 comments
Open

New syslog writer #156

aerturk opened this issue Jul 18, 2020 · 7 comments

Comments

@aerturk
Copy link

aerturk commented Jul 18, 2020

Hello,

I think there is no feature in tinylog to send logs to a remote syslog server like other logging frameworks. If there a way to send to syslog by using another appender/binding or is it hard to add something like a syslogappender? Thank you.

@thewindsofwinter
Copy link

Hello! If there's no one working on this I could try to do this -- I'm not quite familiar with the code though so any steps I should go to get started in the right direction?

@pmwmedia
Copy link
Member

pmwmedia commented Feb 3, 2021

Hi Any,

Firstly, you will need a JDK 9 for building tinylog: https://github.com/pmwmedia/tinylog#build-tinylog

All existing writers can be found here: tinylog-impl/src/main/java/org/tinylog/writers

There is also a manual how to create new writers: https://tinylog.org/v2/extending/#custom-writer

I hope these three steps are helpful for implementing the writer. Cannot await your pull request! Please let me know if I can support you somehow.

@thewindsofwinter
Copy link

Will JDK 11 also work or does it have to be JDK 9? I currently have JDK 11 and I don't want to install another one unless it's totally necessary. It says "Newer JDKs cannot compile legacy code" but in my experience usually I don't run into issues.

@pmwmedia
Copy link
Member

pmwmedia commented Feb 3, 2021

For extracting stack trace information on runtime, tinylog 2 uses sun.reflect.Reflection for Java 6-8 and java.lang.StackWalker for Java 9+. This is one reason why tinylog is such fast in benchmarks. Unfortunately, Java 9 and 10 are the only Java versions that support both stack trace extracting APIs. Therefore, tinylog 2 does require Java 9 for building and Java 11 won't work. However, you can download OpenJDK 9 as compressed archive from the official website: https://jdk.java.net/archive/. It does not require any installation. Extracting the archive is enough.

An alternative would be implementing the new syslog writer directly for tinylog 3. This new version of tinylog uses method handles instead of deprecated sun.reflect.Reflection. This breaks support for Java 6 and 7, but does compile with Java 11.

@thewindsofwinter
Copy link

Alright, thank you very much!

@pmwmedia pmwmedia changed the title log to syslog New syslog writter Nov 25, 2022
@pmwmedia pmwmedia changed the title New syslog writter New syslog writer Nov 25, 2022
@pkarlowicz
Copy link
Contributor

Hello,
I have created a new Syslog writer to address this issue, it's just my first time contributing to a github project and I have a few question about creating a pull request for the change, when trying to push changes to a branch I'm getting access denied error, do I need any access for it or should I create a pull request from a fork ?

@pmwmedia
Copy link
Member

You need to fork tinylog. Afterwards you can push your changes to the branch v2.7 or v.3.0 of your fork. When you are done, you can create a pull request here in this project and choose your fork as base.

@pkarlowicz pkarlowicz mentioned this issue Jul 29, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants