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

Support logging to syslog #95

Open
fabled opened this issue Feb 28, 2025 · 5 comments
Open

Support logging to syslog #95

fabled opened this issue Feb 28, 2025 · 5 comments

Comments

@fabled
Copy link

fabled commented Feb 28, 2025

It would be beneficial if logging to syslog instead of (or in addition to) files would be supported.

@alexpevzner
Copy link
Member

OK, accepted. Thanks a lot, @fabled, for your patience and collaboration!

@fabled
Copy link
Author

fabled commented Mar 7, 2025

OK, accepted. Thanks a lot, @fabled, for your patience and collaboration!

Thanks!

I'm actually trying to debug an issue where a HP printer randomly drops the last page of a job. Usually in a duplex printout the last half of the page is empty. The printer errors the job, but it seems that on IPP level (based on Cups backend debug logs) everything seems OK. So I'm trying to figure out if something weird happens on lower USB levels. Or if its just the printer firmware broken.

@fabled
Copy link
Author

fabled commented Mar 7, 2025

The printer errors the job, but it seems that on IPP level (based on Cups backend debug logs) everything seems OK. So I'm trying to figure out if something weird happens on lower USB levels.

To clarify. Even if we send the same exact print data, it usually works ok, but randomly this issue will happen.

The exact data sent to printer is not identical because Go http will rework the chunked transfer-encoding chunks. Any idea if it would be easily possibly to change so that the HTTP body chunks sent are bit identical?

@alexpevzner
Copy link
Member

Changing this is not easy, and I actually depend on a fact that chunks sent to the printer are independent from the chunks received from the client, because it allows me to always finish the HTTP transaction correctly, even if client drops the connection in the middle and without need to buffer the entire client's data before forwarding to the printer.

However, data actually sent to the printer (at the real USB level) can be logged by enabling the trace-usb log level.

@alexpevzner
Copy link
Member

alexpevzner commented Mar 7, 2025

You may play a little bit with the ipp-usb predecessor, the ippusbxd program (https://github.com/OpenPrinting/ippusbxd/).

Unlike ipp-usb, this program just relays incoming TCP connection to the USB, without any modifications or interpretation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants