]> wagnertech.de Git - mfinanz.git/commitdiff
Separates Logging für die Console.
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 13 May 2011 09:06:16 +0000 (11:06 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 13 May 2011 09:06:16 +0000 (11:06 +0200)
Wenn man mit Userrechten arbeitet gibt es ständig Konflikte welcher Prozess nun
auf das Logfile zugreifen darf. LXDebug ignoriert das still, aber Log4Perl
stirbt mit einer Fehlermeldung. Ab nu gibt es eine separate Logdatei für die
Konsole, und gut ist.

Conflicts:

SL/DB.pm
scripts/console

SL/DBConnect.pm
SL/LXDebug.pm
config/lx_office.conf.default
scripts/console

index fbcf1d5a17d42b3889f83e95aec35e9446380fed..4e084502a6fc8a77c14c2034f200411efacd6725 100644 (file)
@@ -12,7 +12,7 @@ sub connect {
   require Log::Log4perl;
   require DBIx::Log4perl;
 
-  my $filename =  $LXDebug::file_name;
+  my $filename =  $::lxdebug->file;
   my $config   =  $::lx_office_conf{debug}->{dbix_log4perl_config};
   $config      =~ s/LXDEBUGFILE/${filename}/g;
 
index b24372445157402e1726d6e9b1dbfa52642a6eb5..1f0110f391ff39a89f55abe25a4d2672d25388dc 100644 (file)
@@ -292,4 +292,8 @@ sub want_request_timer {
   $global_level & REQUEST_TIMER;
 }
 
+sub file {
+  @_ == 2 ? $_[0]->{file} = $_[1] : $_[0]->{file};
+}
+
 1;
index e78f2c357dc899464f780cce62b36a31ec385c85..ef620c0e2e7b20bd529c861c44060b5b94d5ee87 100644 (file)
@@ -171,6 +171,10 @@ login =
 # location of history file for permanent history
 history_file = users/console_history
 
+# location of a separate log file for the console. everything normally written
+# to the lx-office log will be put here if triggered from the console
+log_file = /tmp/lxoffice_console_debug.log
+
 [debug]
 # Use DBIx::Log4perl for logging DBI calls. The string LXDEBUGFILE
 # will be replaced by the file name configured for $::lxdebug.
index 78b73055920ed497c607173b0730d8104caf710f..fa570c3beb90680e74a11bb9edf97e62dc8aba68 100755 (executable)
@@ -18,6 +18,7 @@ SL::LxOfficeConf->read;
 
 my $login        = shift || $::lx_office_conf{console}{login}        || 'demo';
 my $history_file =          $::lx_office_conf{console}{history_file} || '/tmp/lxoffice_console_history.log'; # fallback if users is not writable
+my $debug_file   =          $::lx_office_conf{Console}{log_file}     || '/tmp/lxoffice_console_debug.log';
 my $autorun      =          $::lx_office_conf{console}{autorun};
 
 # will be configed eventually
@@ -58,7 +59,7 @@ sub lxinit {
 
   package main;
 
-  $::lxdebug = LXDebug->new;
+  $::lxdebug = LXDebug->new(file => $debug_file);
   $::locale = Locale->new($::lx_office_conf{system}->{language});
   $::cgi    = CGI->new qw();
   $::form   = Form->new;