Hi everyone - not strictly a seaside question - but as many of you deploy seaside on web servers, you may know what I'm talking about.
I have a Pharo image in one of the wonderful BA Docker containers, and it runs well - and the host I'm using will show the logs for you, so you can figure out what is going on... well that is if your logs come out properly (and of course, if it gets really hairy then you can get a VNC session onto the image and figure stuff out)
So logs are handy, and pharo these days has a nice headless mode that redirects the Transcript to stdout - and there are also a few decent logging frameworks as well.
But as most things go to the Transcript, and that goes to stdout - it should be good.
HOWEVER - flushing is the killer, as if things happen and the last thing goes wrong, but the output isn't flushed, then you aren't going to see it.
So my question is how to properly flush? And I'm sure I've read something about this before, but I can't find it.
From memory, you often need to have a Transcript cr. to flush your last line.
BUT, most things in the pharo image seem to use "self crTrace:" these days, which is a cr to ensure the previous msg is separated from what you want to write, and then you write your line out. However, as there is no cr - you might not see it.
So I tried changing my stuff to use "self traceCr:" (which is in the image), and that still didn't seem to work - the last failing line wasn't being output. Worse still, its confusing, as many things in the image are using crTrace: and so you get intermingled messages, which are hard to decipher.
So I tried: Transcript cr; show: msg; flush
But that didn't seem to work (which I don't understand)
Eventually I did: Transcript show: msg; cr; flush
And this seems to ensure things do reliably get outputted - but I'm wondering if anyone can shed light on this areas?
Ideally I want to use: Transcript cr'; show: msg; flush.
But having said this - I do wonder if tools like Papertrail or Betterstack won't work with this as they want a full line of text to parse into syslog format (and so they need the cr to terminate a line).
Stef did mention on the Pharo list to check the Stdio class, which did mention an anomaly about doing a #sync after a #flush (which I've never heard of).
So I'm just wondering what all of you do for your seaside logging? Do you use some of the modern web based server tools like other web kids seem to do?
Tim
p.s. While I'm not using Seaside, I've been having quite a bit of fun playing with CodeParadise, which borrows ideas from Seaside but with its WebSocket approach and direct Dom manipulation seems a bit more modern (although its a bit bleeding edge)