Score:0

Apache Custom Error Log Entry

us flag

I have a rule in my Apache config like this:

<FilesMatch "xyz">
 Order deny,allow
 Deny from all
 ErrorDocument 403 "Custom Response"
</FilesMatch>

In the error log it will always add an entry like:

[Fri Apr 14 09:46:10.706192 2023] [access_compat:error] [pid 12345] [client 93.184.216.34:47540] AH01797: client denied by server configuration: /var/www/example.com/xyz

Is there any way to add a custom error message there in the log? I'd like to either alter, append to the existing error message or add an additional log entry with a text string specified in my config file.

I looked at using Custom Log Formats and it does seem to accept environment variables, but I'm unclear if I can use it to accomplish my goal.

I also looked into Apache's Error directive, but this doesn't seem possible due to the fact that "this directive cannot be conditonally evaluated'

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.