Opened 9 years ago

Closed 9 years ago

#4092 closed defect (fixed)

AC - missing new line in logs.

Reported by: khimtiki Owned by:
Priority: major Component: General
Severity: Please fill in Keywords:
Cc: Sensitive: no

Description

OSCam doesn't log with new line (anticasc).
Please take a look in attachment.

Attachments (3)

logs.txt (948 bytes ) - added by khimtiki 9 years ago.
logs_2.txt (783 bytes ) - added by khimtiki 9 years ago.
logs_3.txt (1.4 KB ) - added by khimtiki 9 years ago.

Download all attachments as: .zip

Change History (11)

by khimtiki, 9 years ago

Attachment: logs.txt added

comment:1 by gf, 9 years ago

Can you try this, just move strcat outside of the brackets.

diff --git a/oscam-log.c b/oscam-log.c
index 6af5786..d62c34e 100644
--- a/oscam-log.c
+++ b/oscam-log.c
@@ -309,8 +309,8 @@ static void write_to_log(char *txt, struct s_log *log, int8_t do_flush)
    {
        if(cfg.logtosyslog)
            { syslog(LOG_INFO, "%s", txt + 29); }
-       strcat(txt, "\n");
    }
+   strcat(txt, "\n");
    cs_write_log(txt + 8, do_flush);
 
 #if defined(WEBIF) || defined(MODULE_MONITOR)

comment:2 by gf, 9 years ago

After looking at this closely, this is the correct solution, so I commited in r10341. Please this or later revision and close the ticket if it works.

comment:3 by khimtiki, 9 years ago

Thx for update, it's partially fixed :) See attached log.

by khimtiki, 9 years ago

Attachment: logs_2.txt added

comment:4 by gf, 9 years ago

The whole ac_log is a mess. Anyway try this:

diff --git a/oscam-log.c b/oscam-log.c
index d62c34e..f1e5aa6 100644
--- a/oscam-log.c
+++ b/oscam-log.c
@@ -305,7 +305,7 @@ static void write_to_log(char *txt, struct s_log *log, int8_
    (void)log; // Prevent warning when WEBIF, MODULE_MONITOR and CS_ANTICASC are

    // anticascading messages go to their own log
-   if (!anticasc_logging(txt + log->header_len))
+   if (!anticasc_logging(txt + 8))
    {
        if(cfg.logtosyslog)
            { syslog(LOG_INFO, "%s", txt + 29); }
Last edited 9 years ago by gf (previous) (diff)

comment:5 by gf, 9 years ago

Fix commited in r10343. I don't how know ac_log looked before. Now you'll have full time stamp which is useful.

Last edited 9 years ago by gf (previous) (diff)

comment:6 by khimtiki, 9 years ago

I've pasted in first logs.txt how it looked. Anyway, still wrong. Take a look for new logs_3.txt for more details.

by khimtiki, 9 years ago

Attachment: logs_3.txt added

comment:7 by gf, 9 years ago

Thanks for the log, try r10346.

Last edited 9 years ago by gf (previous) (diff)

comment:8 by khimtiki, 9 years ago

Resolution: fixed
Status: newclosed

r10346 fixed ac logs format :)
Thanks @gf!

Note: See TracTickets for help on using tickets.