iseif has asked for the wisdom of the Perl Monks concerning the following question:
I'm building a Server-Client app with Perl/Mojolicious and JQuery. The server generates a log file using the Log::Log4perl and send the log file name back to the client so the client can see the progress. In the client I use a regular HTML A link to the log file as:
<a href="logs/blabla.log">See log file</a>The problem is I click on the 'See log file' in the client side, the browser shows that the file is loading and stuck until the server finishing writing to the file - just then i can see the content of the file.
I configed the Log::Log4perl to autoflush and tried to use 'log4perl.appender.Syncer' and even set the buffer to 0 or 1: log4perl.appender.Buffer but nothing helped - my Log::Log4perl config is:
How can I see the content of the log file when the server is updating it?log4perl.appender.myFILE = Log::Log4perl::Appender::File log4perl.appender.myFILE.filename = $logfile_name log4perl.appender.myFILE.create_at_logtime = 1 log4perl.appender.myFILE.mode = write log4perl.appender.myFILE.autoflush = 1 log4perl.appender.myFILE.umask = 0000, log4perl.appender.myFILE.layout = Log::Log4perl::Layout::Pattern +Layout log4perl.appender.myFILE.layout.ConversionPattern = [%p][%d{HH:mm} +]: %m%n
Thanks a lot and have a nice week,
Seif.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: View content of Log::Log4perl log file while logger is running
by karlgoethebier (Abbot) on Dec 08, 2013 at 20:27 UTC | |
|
Re: View content of Log::Log4perl log file while logger is running
by taint (Chaplain) on Dec 08, 2013 at 09:41 UTC | |
by iseif (Novice) on Dec 08, 2013 at 10:30 UTC | |
by taint (Chaplain) on Dec 08, 2013 at 11:08 UTC | |
|
Re: View content of Log::Log4perl log file while logger is running
by Tanktalus (Canon) on Dec 10, 2013 at 17:34 UTC |