From: rettenbe Date: Wed, 19 Mar 2008 08:24:30 +0000 (+0000) Subject: more debug infos from 'create_new_ldap_handle' X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=da11c2bb33eee8c115a2db7e80736bbeea520f41;p=gosa.git more debug infos from 'create_new_ldap_handle' git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9936 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 52bd3181a..54b36fd00 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1287,16 +1287,19 @@ sub watch_for_new_jobs { sub refresh_ldap_handle { + my ($session_id) = @_ ; + if (not defined $session_id) { $session_id = 0; } + my $mesg; - daemon_log("DEBUG: Trying to create a connection to URI $ldap_uri", 5); + daemon_log("$session_id DEBUG: Trying to create a connection to URI '$ldap_uri'", 7); # Get an ldap handle, if we don't have one if( ! defined $ldap_handle ){ $ldap_handle = Net::LDAP->new( $ldap_uri ); } # Still not defined? if( ! defined $ldap_handle ) { - daemon_log( "ch $$: Net::LDAP constructor failed: $!\n" ); + daemon_log( "$session_id ERROR: ch $$: Net::LDAP constructor failed: $!\n" ); return 0; } @@ -1313,10 +1316,10 @@ sub refresh_ldap_handle { if( 0 != $mesg->code ) { undef( $ldap_handle ) if( 81 == $mesg->code ); - daemon_log( "ch $$: LDAP bind: error (". $mesg->code . ') - ' . $mesg->error . "\n", 1); + daemon_log( "$session_id ERROR: ch $$: LDAP bind: error (". $mesg->code . ') - ' . $mesg->error . "\n", 1); return 0; } - + daemon_log("$session_id DEBUG: create a new connection to URI '$ldap_uri'", 7); return 1; } diff --git a/gosa-si/tests/log-parser.pl b/gosa-si/tests/log-parser.pl index 59912a8bf..79885bbab 100755 --- a/gosa-si/tests/log-parser.pl +++ b/gosa-si/tests/log-parser.pl @@ -23,6 +23,7 @@ use warnings; use Getopt::Long; my $log_file = "/var/log/gosa-si-server.log"; +my $within_log_session = 0; my $session; GetOptions("s|session=s" => \$session); @@ -36,16 +37,22 @@ open(FILE, "<$log_file") or die "\t can not open log-file"; # Read lines my $line; while ($line = ){ - next if $line =~ /^\s/; chomp($line); my @line_list = split(" ", $line); - next if not $line_list[4]; + if (not $line_list[4]) { + if ($within_log_session) { + print "$line\n"; + } + next; + } if($line_list[4] eq $session) { - print "$line\n"; - - } + $within_log_session = 1; + + } else { + $within_log_session = 0; + } }