Revision 97358b9b
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
SL/DBConnect.pm | ||
---|---|---|
12 | 12 |
require Log::Log4perl; |
13 | 13 |
require DBIx::Log4perl; |
14 | 14 |
|
15 |
my $filename = $LXDebug::file_name;
|
|
15 |
my $filename = $::lxdebug->file;
|
|
16 | 16 |
my $config = $::lx_office_conf{debug}->{dbix_log4perl_config}; |
17 | 17 |
$config =~ s/LXDEBUGFILE/${filename}/g; |
18 | 18 |
|
SL/LXDebug.pm | ||
---|---|---|
292 | 292 |
$global_level & REQUEST_TIMER; |
293 | 293 |
} |
294 | 294 |
|
295 |
sub file { |
|
296 |
@_ == 2 ? $_[0]->{file} = $_[1] : $_[0]->{file}; |
|
297 |
} |
|
298 |
|
|
295 | 299 |
1; |
config/lx_office.conf.default | ||
---|---|---|
171 | 171 |
# location of history file for permanent history |
172 | 172 |
history_file = users/console_history |
173 | 173 |
|
174 |
# location of a separate log file for the console. everything normally written |
|
175 |
# to the lx-office log will be put here if triggered from the console |
|
176 |
log_file = /tmp/lxoffice_console_debug.log |
|
177 |
|
|
174 | 178 |
[debug] |
175 | 179 |
# Use DBIx::Log4perl for logging DBI calls. The string LXDEBUGFILE |
176 | 180 |
# will be replaced by the file name configured for $::lxdebug. |
scripts/console | ||
---|---|---|
18 | 18 |
|
19 | 19 |
my $login = shift || $::lx_office_conf{console}{login} || 'demo'; |
20 | 20 |
my $history_file = $::lx_office_conf{console}{history_file} || '/tmp/lxoffice_console_history.log'; # fallback if users is not writable |
21 |
my $debug_file = $::lx_office_conf{Console}{log_file} || '/tmp/lxoffice_console_debug.log'; |
|
21 | 22 |
my $autorun = $::lx_office_conf{console}{autorun}; |
22 | 23 |
|
23 | 24 |
# will be configed eventually |
... | ... | |
58 | 59 |
|
59 | 60 |
package main; |
60 | 61 |
|
61 |
$::lxdebug = LXDebug->new; |
|
62 |
$::lxdebug = LXDebug->new(file => $debug_file);
|
|
62 | 63 |
$::locale = Locale->new($::lx_office_conf{system}->{language}); |
63 | 64 |
$::cgi = CGI->new qw(); |
64 | 65 |
$::form = Form->new; |
Auch abrufbar als: Unified diff
Separates Logging für die Console.
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: