Skip to content

Commit 28e2b35

Browse files
committed
Change: log server only
1 parent 696c60b commit 28e2b35

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

logtofile_bgw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void PgAuditLogToFileMain(Datum arg)
6666
PgAuditLogToFileContext = AllocSetContextCreate(CurrentMemoryContext, "pgauditlogtofile loop context",
6767
ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE);
6868

69-
ereport(LOG, (errmsg("pgauditlogtofile worker started")));
69+
ereport(LOG_SERVER_ONLY, (errmsg("pgauditlogtofile worker started")));
7070

7171
MemoryContextSwitchTo(PgAuditLogToFileContext);
7272

@@ -117,7 +117,7 @@ void PgAuditLogToFileMain(Datum arg)
117117

118118
MemoryContextReset(PgAuditLogToFileContext);
119119

120-
ereport(LOG, (errmsg("pgauditlogtofile worker shutting down")));
120+
ereport(LOG_SERVER_ONLY, (errmsg("pgauditlogtofile worker shutting down")));
121121

122122
proc_exit(0);
123123
}

logtofile_log.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,9 @@ bool pgauditlogtofile_open_file(void)
256256
}
257257
else
258258
{
259-
int save_errno = errno;
260-
ereport(ERROR,
259+
ereport(LOG_SERVER_ONLY,
261260
(errcode_for_file_access(),
262261
errmsg("could not open log file \"%s\": %m", pgaudit_ltf_shm->filename)));
263-
errno = save_errno;
264262
}
265263

266264
return opened;
@@ -297,12 +295,10 @@ bool pgauditlogtofile_write_audit(const ErrorData *edata, int exclude_nchars)
297295

298296
if (rc != buf.len)
299297
{
300-
int save_errno = errno;
301-
ereport(ERROR,
298+
ereport(LOG_SERVER_ONLY,
302299
(errcode_for_file_access(),
303300
errmsg("could not write audit log file \"%s\": %m", filename_in_use)));
304301
pgauditlogtofile_close_file();
305-
errno = save_errno;
306302
}
307303

308304
return rc == buf.len;

0 commit comments

Comments
 (0)