On 11/12/2013, Heikki Vatiainen wrote:
> On 11/12/2013 06:12 PM, David Zych wrote:
>>>> >>> Now, however, I'm trying to put my Radiator servers behind a server 
>>>> >>> load balancer (SLB); every few seconds, the SLB sends a health check 
>>>> >>> request which Radiator is configured to REJECT (this is safer than 
>>>> >>> ACCEPT and equally effective proof that the server is alive and 
>>>> >>> answering).  The problem is that each REJECT generates INFO-level log 
>>>> >>> output which is cluttering up my logs:
>>>> >>>
>>>> >>> Fri Nov  8 16:56:03 2013 416230: INFO: Access rejected for 
>>>> >>> SI_radius_keepalive: L7 Health Check from SLB
>>> >>
>>> >> would a good solution be to change the log
>>> >> level of reject messages to something else? What could be done is to
>>> >> make the log level of these messages configurable.
>> > 
>> > This would be great!  (ideally as a per-Handler config option, so that I
>> > could set it to DEBUG for this one Handler but leave it alone for others)
> Global option would be possible at least. Lets see what it would take to
> have it as a per Handler option. Value for per Handler option should
> probably default to the global option so it can be overridden easily.
> 
> I'll get back to this when there is something to test.

Thanks!

On a separate but related note, my global DEBUG-level logger has become much 
less useful now that even my dev systems are receiving uninteresting requests 
from the SLB every 5 seconds, so I've started playing around with PacketTrace 
as a way to debug only the thing(s) I'm actually interested in at any given 
moment.

My problem with PacketTrace as currently implemented is that it adds packet 
dumps to _every_ global logger, whereas I'd really like to control where they 
go and e.g. not send them to syslog.

I suggest a new config flag for LogGeneric which tells individual loggers *not* 
to participate in PacketTrace, used like so:

# include PacketTrace debugging here
<Log FILE>
  Filename %L/general/%Y/%m/logfile.%Y-%m-%d
  LogFormat %Y-%m-%dT%H:%M:%S.%s %{Server:Identifier}: %1: %2
  Trace 2
</Log>

# but not here
<Log SYSLOG>
  IgnorePacketTrace
  LogSock udp
  LogHost %{GlobalVar:LogHost}
  LogIdent %{Server:Identifier}
  Facility user
  Trace 2
</Log>

My (very simple) patch is below.  Confession: I have no idea what the "1" in 
the arrayref signifies.

David


diff -ruN radiator-20131111/radiator/lib/perl5/Radius/LogGeneric.pm 
radiator-20131111.dmrzhacks/radiator/lib/perl5/Radius/LogGeneric.pm
--- radiator-20131111/radiator/lib/perl5/Radius/LogGeneric.pm   2013-09-06 
07:58:30.000000000 -0500
+++ radiator-20131111.dmrzhacks/radiator/lib/perl5/Radius/LogGeneric.pm 
2013-11-13 17:28:19.000000000 -0600
@@ -23,6 +23,9 @@
  ['integer', 
   'Sets the maximum length of log messages. All messages longer than 
MaxMessageLength characters wil be truncated to MaxMessageLength.', 
   1],
+ 'IgnorePacketTrace'  => 
+ ['flag', 
+  'Exclude this logger from PacketTrace debugging', 1],
  );
 
 # RCS version number of this module
@@ -78,7 +81,7 @@
 {
     my ($self, $priority, $p) = @_;
 
-    return $priority <= $self->{Trace} || ($p && $p->{PacketTrace});
+    return $priority <= $self->{Trace} || ($p && $p->{PacketTrace} && ! 
$self->{IgnorePacketTrace});
 }
 
 #####################################################################
_______________________________________________
radiator mailing list
[email protected]
http://www.open.com.au/mailman/listinfo/radiator

Reply via email to