- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit8b76f89
committed
Refactor fallback to stderr for csvlog to handle better WIN32 service case
send_message_to_server_log() would force a redirection of a log entry tostderr in some cases for csvlog, like the syslogger not being availableyet. If this happens, csvlog would fall back to stderr to logsome information rather than nothing. The code was organized so asstderr is done before csvlog, with csvlog checking that stderr did nothappen yet with a reversed condition. With this code organization, itcould be possible to lose some messages if running Postgres as a serviceon WIN32, as there is no usable stderr, and the handling of theStringInfoData holding the message for stderr was rather confusingbecause of that.This commit moves the csvlog handling to be before stderr, as as we areable to track down if it is necessary to log something to stderr. Thereduces the handling of stderr to be in a single code path, adding afallback to event logs for a WIN32 service. This also simplifies theway we handle the StringInfoData for stderr, making easier theintegration of new file-based log destinations. I got to play withservices and event logs on Windows while checking this change.Reviewed-by: Chris BandyDiscussion:https://postgr.es/m/YV0vwBovEKf1WXkl@paquier.xyz1 parent08e2daf commit8b76f89
1 file changed
+24
-30
lines changedLines changed: 24 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3008 | 3008 |
| |
3009 | 3009 |
| |
3010 | 3010 |
| |
| 3011 | + | |
3011 | 3012 |
| |
3012 | 3013 |
| |
3013 | 3014 |
| |
| |||
3159 | 3160 |
| |
3160 | 3161 |
| |
3161 | 3162 |
| |
3162 |
| - | |
3163 |
| - | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
3164 | 3184 |
| |
3165 | 3185 |
| |
3166 | 3186 |
| |
| |||
3189 | 3209 |
| |
3190 | 3210 |
| |
3191 | 3211 |
| |
3192 |
| - | |
3193 |
| - | |
3194 |
| - | |
3195 |
| - | |
3196 |
| - | |
3197 |
| - | |
3198 |
| - | |
3199 |
| - | |
3200 |
| - | |
3201 |
| - | |
3202 |
| - | |
3203 |
| - | |
3204 |
| - | |
3205 |
| - | |
3206 |
| - | |
3207 |
| - | |
3208 |
| - | |
3209 |
| - | |
3210 |
| - | |
3211 |
| - | |
3212 |
| - | |
3213 |
| - | |
3214 |
| - | |
3215 |
| - | |
3216 |
| - | |
3217 |
| - | |
3218 |
| - | |
3219 |
| - | |
| 3212 | + | |
| 3213 | + | |
3220 | 3214 |
| |
3221 | 3215 |
| |
3222 | 3216 |
| |
|
0 commit comments
Comments
(0)