Skip to content

Import twisted.logger.rsyslog.RemoteSyslogObserver#12465

Open
uedvt359 wants to merge 4 commits intotwisted:trunkfrom
uedvt359:trunk
Open

Import twisted.logger.rsyslog.RemoteSyslogObserver#12465
uedvt359 wants to merge 4 commits intotwisted:trunkfrom
uedvt359:trunk

Conversation

@uedvt359
Copy link

@uedvt359 uedvt359 commented Jun 3, 2025

Scope and purpose

Fixes #12464

The twisted.python.syslog.SyslogObserver can only forwards logs to the local syslog (which is fine per se). RemoteSyslogObserver directly sends Syslog messages over the network, without going through local syslog.

  • Happy to receive feedback now, will un-draft this PR once I have written tests and documentation for it (unless instructed otherwise)
  • I usually amend my commit(s) instead of adding additional fixup commits for addressing review comments. If you would prefer the latter, just say so.

@codspeed-hq
Copy link

codspeed-hq bot commented Jun 3, 2025

CodSpeed Performance Report

Merging #12465 will improve performances by 2.26%

Comparing uedvt359:trunk (2c92aca) with trunk (aedee3e)

Summary

⚡ 1 improvements
✅ 35 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
test_http11_server_chunked_request 1.8 ms 1.8 ms +2.26%

@uedvt359
Copy link
Author

uedvt359 commented Jun 3, 2025

Review comments from @glyph addressed in push c5caa41:

  • moved from top-level logger namespace to twisted.logger.rsyslog package
  • inlined constants from python's syslog stdlib / #include<syslog.h>

addressed in push 6881912:

  • documentation

This still leaves:

  • unit tests

I realize that log messages are kind of a special case in terms of eager delivery being really important, but the reactor is already eager, and shouldn't block; have you considered using, or at least supporting, twisted's built-in UDP support?

I would prefer to use Twisted's nonblocking implementation, but I'm not sure how exactly, so I chose to simply use a socket for now. I will look into it again.

rSyslog is allowed over TCP as well, so a solution should work with both transports.

@uedvt359 uedvt359 force-pushed the trunk branch 2 times, most recently from 0c7e4c6 to da5b27f Compare June 3, 2025 12:52
@uedvt359 uedvt359 force-pushed the trunk branch 5 times, most recently from 0852967 to 7bfbc26 Compare June 11, 2025 14:59
@uedvt359 uedvt359 force-pushed the trunk branch 2 times, most recently from 44ed650 to df3527a Compare June 25, 2025 07:25
@uedvt359 uedvt359 marked this pull request as ready for review July 15, 2025 09:19
@chevah-robot chevah-robot requested a review from a team July 15, 2025 09:19
@uedvt359
Copy link
Author

uedvt359 commented Jul 15, 2025

I'm setting this branch to reviewable, because I need some help with the tests, please. I don't understand how I can fake a reactor for my use case.

The CI also wants me to add MyPy type hints - something I am failing at (and could use some hints for) as well :|

pinging @glyph, since you already looked at the original issue.

Copy link
Member

@glyph glyph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't getting looked at because I tend to exclude things with failing tests when I look at the review queue. Let's maybe find some time to pair program on this, if you have any, or if not, I'll have to look at this myself later; let me know.

@uedvt359
Copy link
Author

This wasn't getting looked at because I tend to exclude things with failing tests when I look at the review queue.

No worries about the delay.

Let's maybe find some time to pair program on this, if you have any

I'd love to!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Remote Syslog LogObserver [will provide patch]

3 participants