Menu

#38 Tag-Identifier value for parallel logging

closed
None
5
2024-09-18
2024-02-12
No

Hello,

when I try to use emailrelay in production environment with huge mail flows, really hard to analysis logs.
as you know it accept multiple mails at same time and log this one. but we lose our way when analyzing logs.
so, can you add any value for tracking logs for same message?

1 Attachments

Discussion

  • Graeme Walker

    Graeme Walker - 2024-02-12

    Would adding the incoming connection's port number to the "--log-address" string be sufficient? That's a one line change to src/gnet/gserverpeer.cpp : replace hostPartString() with displayString().

     
  • Yunus YILDIRIM

    Yunus YILDIRIM - 2024-02-13

    yeap, it would be okay.
    I test it and it worked.

     
  • Graeme Walker

    Graeme Walker - 2024-02-13

    Okay, I'll leave this ticket open and give it some more thought before the next release.

    I would appreciate it if you could add a review ( https://sourceforge.net/projects/emailrelay/reviews/ ) with more information on how you are using emailrelay (inc. o/s and mail volumes).

     
    👍
    1
  • Yunus YILDIRIM

    Yunus YILDIRIM - 2024-02-14

    hi again Graeme,

    can we add same details or another one for forwarded mails? in GSmtp::ClientProtocol lines.

     
  • Graeme Walker

    Graeme Walker - 2024-02-15

    The client side should be less of a problem to disentangle because there is usually only one client connection at a time. (There can be multiple client connections if you are forwarding via --admin or using --immediate or if you have more than one configuration.)

    If you want to add client-side logging using the same mechanism as on the server side then I have attached a patch. It logs the local address including the port number, which should be unique enough for disentanglement because port numbers will not be reused immediately.

    Or you could also just modify the G_LOG lines in src/gsmtp/gsmtpclientprotocol.cpp to log whatever you want. For example, to add the message id:

    G_LOG( "GSmtp::ClientProtocol: " << m_message_state.id << ": tx>>:" ...
    
     
  • Yunus YILDIRIM

    Yunus YILDIRIM - 2024-02-29

    second one is good solution;
    add m_message_state.id to log line

     
  • Graeme Walker

    Graeme Walker - 2024-03-18

    So I have now added a "--log-format" option that can be used to add additional fields to the log output, in addition to the existing "--log-address" option. In your case you would use "--log-format=address,port,msgid" to get the full TCP address on the server side and the current message-id on the client side.

    The code is checked into SF svn trunk and SF git as version 2.5.3dev1. Please give it a go and let me know what you think.

     
    👍
    1
  • Yunus YILDIRIM

    Yunus YILDIRIM - 2024-04-24

    optional and good feature.
    thanks.

     
  • Graeme Walker

    Graeme Walker - 2024-09-18
    • status: open --> closed
     
  • Graeme Walker

    Graeme Walker - 2024-09-18

    This is in v2.6 as "--log-format=time,address,port,unit,msgid".

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.