Apache weblog status %>s issue


Our Apache web server has been configured so the web logs capture the last status by using the directive %>s however this is producing the following in the log file ???>???s instead of the last correct status number.

Does anyone know why this occurs and how it can be fixed?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Richard QuadlingSenior Software DeveloperCommented:
Can you show your entire LogFormat please?
bcrawley01Author Commented:
LogFormat "%h %v %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\""
Richard QuadlingSenior Software DeveloperCommented:
Can you try %s to make sure that at least this is working? The original status will be logged rather than the last status.

Can you do a hex dump of the log file to see exactly what is ???>???s is.


OOI, Can you try looking at the file containing this logformat in hex mode?

Have you used 16bit UTF format?

25 00 3E 00 73 for the %>s but as %\000>\000s in 8bit mode.

Almost certain this is the issue.

If you view the log file in hex mode, you should probably see that the ??? is really 00 - a null.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

bcrawley01Author Commented:
%s does work and is logging the original status.

When opening the log file in hex, ???>???s is 3F 3F 3F 3E 3F 3F 3F 73
Richard QuadlingSenior Software DeveloperCommented:
Hmm. That's odd.

Really was expecting that to be the tool that displayed the log showing NULLs as ???

Can you put the > back into the log format and do a hex on that.
bcrawley01Author Commented:
That before was with the > added.
Richard QuadlingSenior Software DeveloperCommented:
Yes. But I'm wondering if the editing of the logformat is the issue. Can you show the hex of the file with the logformat in it, not the log file itself.

Whilst it is not likely, but if the logformat is corrupted with nulls (16bit UTF rather than 8bit), then the leading null bytes _COULD_ be shown as ??? and depending upon how the translation is done from logformat to log file, ...

Sort of clutching at straws...

Can you attach the file with the logformat to this question?

bcrawley01Author Commented:
Log format file is attached.
Richard QuadlingSenior Software DeveloperCommented:
As the file is XML, I wonder if %> is getting in the way somehow.

Is the remainder of the log entry exist?
bcrawley01Author Commented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard QuadlingSenior Software DeveloperCommented:
So, \" => " was the issue?

Ha! A million ways to escape and URLencoding never occurred to me.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.