Re: squirrel_logger Plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Banchshikov Dmitry wrote:
> Hello.
>
> In last version if squirrel_logger plugin there is problem, when trying
> to log into syslog. From my point of view, the problem is in the
> sl_log_to_system_log function.
>
> So, we have:
>
> function
> sl_log_to_system_log($message)                                                                                                                     
>
> {                                                                                                                                                           
>
>                                                                                                                                                             
>
>    global
> $sl_syslog_priority;                                                                                                                              
>
>   
> sl_get_config();                                                                                                                                         
>
>                                                                                                                                                             
>
>    syslog($sl_syslog_priority,
> $message);                                                                                                                   
>
>                                                                                                                                                             
>
> }
>
> But we need:
>
>
> function
> sl_log_to_system_log($message)                                                                                                                     
>
> {                                                                                                                                                           
>
>                                                                                                                                                             
>
>    global $sl_syslog_priority, $sl_syslog_facility,
> $sl_syslog_ident;                                                                                       
>
>   
> sl_get_config();                                                                                                                                         
>
>                                                                                                                                                             
>
>    openlog($sl_syslog_ident, 0, $sl_syslog_facility);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    syslog($sl_syslog_priority,
> $message);                                                                                                                   
>
>                                                                                                                                                             
>
> }      
>
> Am I right?
>
>
>
>
>   
Here is patch, to use syslog.



-- 
Banchshikov Dmitry  

--- functions.php	Wed Jun 15 07:53:07 2005
+++ functions.php.patched	Fri Sep  7 11:09:12 2007
@@ -467,9 +467,10 @@
 function sl_log_to_system_log($message)
 {
 
-   global $sl_syslog_priority;
+   global $sl_syslog_priority, $sl_syslog_facility, $sl_syslog_ident;
    sl_get_config();
 
+   openlog($sl_syslog_ident, 0, $sl_syslog_facility);
    syslog($sl_syslog_priority, $message);
 
 }
--- config.php.sample	Wed Jun 15 07:39:30 2005
+++ config.php.peterhost	Fri Sep  7 11:09:12 2007
@@ -3,6 +3,7 @@
    global $sl_logs, $sl_log_events, $data_dir, $sl_logfile, $sl_namelookups, 
           $sl_dateformat, $sl_send_alerts, $sl_mass_mail_limit,
           $sl_alert_to, $sl_alert_cc, $sl_alert_bcc, $sl_syslog_priority,
+	  $sl_syslog_facility, $sl_syslog_ident,
           $sl_alert_subject_template, $sl_log_mass_mailing_show_recipients,
           $sl_log_mass_mailing_show_message_body, $sl_dsn, $sl_insert_event_query,
           $sl_use_GMT, $sl_fail_silently, $skip_domains, $only_log_domains;
@@ -25,7 +26,7 @@
                              'TIMEOUT',
 //                             'MASS_MAILING',
                              'LOGIN_ERROR',
-//                             'ERROR',
+                             'ERROR',
                          );
 
 
@@ -61,19 +62,19 @@
    //
    $sl_logs = array(
       'SYSTEM' => array(
-//         'LOGIN'         =>  "Successful webmail login: by %2 (%3) at %4 on %6%: %7",
-//         'LOGOUT'        =>  "Webmail logout: by %2 (%3) at %4 on %6%: %7",
-//         'TIMEOUT'       =>  "Webmail session timed out: by %2 (%3) at %4 on %6%: %7",
-//         'MASS_MAILING'  =>  "Possible outgoing spam: by %2 (%3) at %4 on %6%: %7",
-//         'LOGIN_ERROR'   =>  "Failed webmail login: by %2 (%3) at %4 on %6%: %7",
-//         'ERROR'         =>  "Webmail error: by %2 (%3) at %4 on %6%: %7",
+         'LOGIN'         =>  "Successful webmail login: by %2 (%3) at %4 on %6: %7",
+         'LOGOUT'        =>  "Webmail logout: by %2 (%3) at %4 on %6: %7",
+         'TIMEOUT'       =>  "Webmail session timed out: by %2 (%3) at %4 on %6: %7",
+//         'MASS_MAILING'  =>  "Possible outgoing spam: by %2 (%3) at %4 on %6: %7",
+         'LOGIN_ERROR'   =>  "Failed webmail login: by %2 (%3) at %4 on %6: %7",
+         'ERROR'         =>  "Webmail error: by %2 (%3) at %4 on %6: %7",
                        ),
       'FILE'   => array(
-         'LOGIN'         =>  "%6 [%1] %2 (%3) from %4: %7\n",
-         'LOGOUT'        =>  "%6 [%1] %2 (%3) from %4: %7\n",
-         'TIMEOUT'       =>  "%6 [%1] %2 (%3) from %4: %7\n",
+//         'LOGIN'         =>  "%6 [%1] %2 (%3) from %4: %7\n",
+//         'LOGOUT'        =>  "%6 [%1] %2 (%3) from %4: %7\n",
+//         'TIMEOUT'       =>  "%6 [%1] %2 (%3) from %4: %7\n",
 //         'MASS_MAILING'  =>  "%6 [%1] %2 (%3) from %4: %7\n",
-         'LOGIN_ERROR'   =>  "%6 [%1] %2 (%3) from %4: %7\n",
+//         'LOGIN_ERROR'   =>  "%6 [%1] %2 (%3) from %4: %7\n",
 //         'LOGIN_ERROR'   =>  "%6 [INVALID] %2 (%3) from %4: %7\n",
 //         'ERROR'         =>  "%6 [%1] %2 (%3) from %4: %7\n",
                        ),
@@ -96,7 +97,8 @@
    //                 LOG_NOTICE, LOG_INFO, LOG_DEBUG
    //
    $sl_syslog_priority = LOG_INFO;  // Default is LOG_INFO
-
+   $sl_syslog_facility = LOG_MAIL;  // Default is LOG_MAIL
+   $sl_syslog_ident    = 'Squirrelmail'; // Default is 'Squirrelmail'
 
 
    // This is a list of the types of events you would like
@@ -127,7 +129,7 @@
    $sl_send_alerts = array(
 //      'MASS_MAILING'  =>  "Possible outgoing spam: by %2 (%3) at %4 on %6%: %7",
 //      'LOGIN_ERROR'   =>  "Failed webmail login: by %2 (%3) at %4 on %6%: %7",
-//      'ERROR'         =>  "Webmail error: by %2 (%3) at %4 on %6%: %7",
+      'ERROR'         =>  "Webmail error: by %2 (%3) at %4 on %6%: %7",
                           );
 
 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux