Outils pour utilisateurs

Outils du site


linux:pound (lu 33169 fois)

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
linux:pound [03-12-2012 09:41]
edmc73
linux:pound [04-04-2013 22:06] (Version actuelle)
Ligne 59: Ligne 59:
 source : http://myfreshthoughts.blogspot.fr/2008/07/howto-tell-pound-to-log-into-its-own.html source : http://myfreshthoughts.blogspot.fr/2008/07/howto-tell-pound-to-log-into-its-own.html
  
 +Normalement, tous les log de Pound se mettent dans /var/log/syslog se qui n'est pas super pratique surtout si on veut utiliser les log de Pound avec Awstats par exemple.
 +Comme il n'y a pas d'option pour spécifier le fichier de log à utiliser, nous allons donc configurer notre système de log pour que ça soit le cas.
  
-Normally, sysklogd will overtake all messages from pound and will put them into syslog as anything with the facility 'daemon' goes in there by default. So first you need to change the LogFacility of pound as it is 'daemon' by default.+Modifiez la config de Pound /etc/pound.conf comme ceci:
  
-Just edit your /etc/pound.conf as follows: +  #On va utilisé le facility local0 pour séparer les messages de pound dans le syslog
- +
-  #facility local0 is needed as sysklogd will +
-  #seperate pound messages by this facility+
   LogFacility local0   LogFacility local0
   LogLevel 3   LogLevel 3
  
-And the change your /etc/syslog.conf +Modifiez ensuite la config de rsyslog /etc/rsyslog.conf
-<note warning>Si le fichier **/etc/syslog.conf** n'existe pas, installez le paquet **sysklogd**</note>+
  
-  # log all (auth and such) to /var/log/syslog +  ############### 
-  # except messages with the facility local0 (pound) +  #### RULES #### 
-  #  +  ############### 
-  *.*;auth,authpriv.none,local0.none -/var/log/syslog+   
 +  # 
 +  # First some standard log files.  Log by facility. 
 +  # 
 +  # On empêche le local0 d'aller dans syslog 
 +  *.*;auth,authpriv.none,local0.none          -/var/log/syslog
  
-  # get the messages with the facility local0 and +  # Prend les messages du facility local0 et 
-  # log them into the pound logfile +  # les inscrit dans un fichier log pound
   local0.* -/var/log/pound.log   local0.* -/var/log/pound.log
  
-The next step is to make sure that there is always a pound.log present. Therefore you need to modify the start script by adding a short conditional block into the top section of /etc/init.d/pound+Après avoir relancé rsyslog /etc/init.d/rsyslog restart et pound /etc/init.d/pound restartvous devriez voir apparaître les 1er log de pound dans son fichier de log /var/log/pound.log
- +
-  # Check if the pound.log exists, if not create one +
-  if [ ! -e "/var/log/pound.log" ] +
-  then +
-    log_warning_msg "There is no pound.logi'll create one" +
-    touch /var/log/pound.log +
-    chmod 0644 /var/log/pound.log +
-    chown syslog:adm /var/log/pound.log +
-    /etc/init.d/sysklogd reload > /dev/null +
-    else +
-    log_success_msg "pound.log was found" +
-    /etc/init.d/sysklogd reload > /dev/null +
-  fi+
  
-After you reloaded the sysklogd by /etc/init.d/sysklogd reload and restarted the poundyou should see the first log entries.+Et comme tout fichier de logvous devez l'intégrer dans logrotate afin de ne pas se retrouver avec un fichier de log de 10Go ...
  
-In my case the logfile increased to a size of more than 900 Mbyte after 24 hours, so don't forget to rotate the log. This could be done like this (/etc/logrotate.d/pound)+Nous allons donc créer le fichier /etc/logrotate.d/pound contenant
  
   /var/log/pound.log {   /var/log/pound.log {
-    daily+    weekly
     missingok     missingok
-    rotate 14 +    rotate 52
-    dateext +
     compress     compress
     notifempty     notifempty
     create 0644 syslog adm     create 0644 syslog adm
     postrotate     postrotate
-    /etc/init.d/sysklogd reload > /dev/null+      invoke-rc.d rsyslog reload > /dev/null
     endscript     endscript
-}+  }
      
linux/pound.1354524112.txt.gz · Dernière modification: 04-04-2013 22:05 (modification externe)