Log4s / can multiple images write to a common log file?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Log4s / can multiple images write to a common log file?

jtuchel
Hi there,

this may be a dumb question, but I haven't found anything about this in the docs.

We have multiple Seaside Server images running, each of them being identical (load balancing). Now that we need this balancing, things get a bit more complicated and so we'd like to still have all of them writing to ony ony log file. We use a Daily Rolling File Appender for our logging.

So here is my question:

Is it safe to have multiple Images apending to one common log file? Does the daily rolling still work? (All images are on the same machine, so we can hopefully ignore time differences here).

I guess there are some issues like concurrent write access to the log file and (as mentioned) the renaming of the log file when a new day starts. Will these only result in short "waits" for the file to be available for write or will the whole thing break down?

Any experiences, tricks, ideas?

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Log4s / can multiple images write to a common log file?

Louis LaBrunda
Hi Joachim,

I think on windows you are out of luck, not sure about Linux.  I'm pretty sure windows locks the file if you have it open for write.  If you have control and can close the file after each log entry and reopen (append) for the next, you might get away with it.  You could still have a write conflict but with luck it would be rare.

Lou

On Monday, November 14, 2016 at 7:39:51 AM UTC-5, Joachim Tuchel wrote:
Hi there,

this may be a dumb question, but I haven't found anything about this in the docs.

We have multiple Seaside Server images running, each of them being identical (load balancing). Now that we need this balancing, things get a bit more complicated and so we'd like to still have all of them writing to ony ony log file. We use a Daily Rolling File Appender for our logging.

So here is my question:

Is it safe to have multiple Images apending to one common log file? Does the daily rolling still work? (All images are on the same machine, so we can hopefully ignore time differences here).

I guess there are some issues like concurrent write access to the log file and (as mentioned) the renaming of the log file when a new day starts. Will these only result in short "waits" for the file to be available for write or will the whole thing break down?

Any experiences, tricks, ideas?

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Log4s / can multiple images write to a common log file?

jtuchel

Oh, sorry for not mentioning it.
This is on Linux.




Am Montag, 14. November 2016 17:10:09 UTC+1 schrieb Louis LaBrunda:
Hi Joachim,

I think on windows you are out of luck, not sure about Linux.  I'm pretty sure windows locks the file if you have it open for write.  If you have control and can close the file after each log entry and reopen (append) for the next, you might get away with it.  You could still have a write conflict but with luck it would be rare.

Lou

On Monday, November 14, 2016 at 7:39:51 AM UTC-5, Joachim Tuchel wrote:
Hi there,

this may be a dumb question, but I haven't found anything about this in the docs.

We have multiple Seaside Server images running, each of them being identical (load balancing). Now that we need this balancing, things get a bit more complicated and so we'd like to still have all of them writing to ony ony log file. We use a Daily Rolling File Appender for our logging.

So here is my question:

Is it safe to have multiple Images apending to one common log file? Does the daily rolling still work? (All images are on the same machine, so we can hopefully ignore time differences here).

I guess there are some issues like concurrent write access to the log file and (as mentioned) the renaming of the log file when a new day starts. Will these only result in short "waits" for the file to be available for write or will the whole thing break down?

Any experiences, tricks, ideas?

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Log4s / can multiple images write to a common log file?

dmacq
Hi Joachim,

Log4s is in my wheel house as they say so I will take a stab at this.  There is nothing in the log4s code that prohibits multiple images writing to the same log file.  As others have said, I think your biggest obstacle might be OS file locks.  If locks are a problem, you might be able to open the file, do the write, and then close the file.

I'd say give it a whirl. Let us know how it goes.

Donald [|]


On Monday, November 14, 2016 at 11:21:51 AM UTC-5, Joachim Tuchel wrote:

Oh, sorry for not mentioning it.
This is on Linux.




Am Montag, 14. November 2016 17:10:09 UTC+1 schrieb Louis LaBrunda:
Hi Joachim,

I think on windows you are out of luck, not sure about Linux.  I'm pretty sure windows locks the file if you have it open for write.  If you have control and can close the file after each log entry and reopen (append) for the next, you might get away with it.  You could still have a write conflict but with luck it would be rare.

Lou

On Monday, November 14, 2016 at 7:39:51 AM UTC-5, Joachim Tuchel wrote:
Hi there,

this may be a dumb question, but I haven't found anything about this in the docs.

We have multiple Seaside Server images running, each of them being identical (load balancing). Now that we need this balancing, things get a bit more complicated and so we'd like to still have all of them writing to ony ony log file. We use a Daily Rolling File Appender for our logging.

So here is my question:

Is it safe to have multiple Images apending to one common log file? Does the daily rolling still work? (All images are on the same machine, so we can hopefully ignore time differences here).

I guess there are some issues like concurrent write access to the log file and (as mentioned) the renaming of the log file when a new day starts. Will these only result in short "waits" for the file to be available for write or will the whole thing break down?

Any experiences, tricks, ideas?

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.