+3991. [func] Add the ability to buffer logging output by specifying
+ "buffered yes;" when defining a channel. [RT #26561]
+
3990. [testing] Add tests for unknown DNSSEC algorithm handling.
[RT #37541]
const cfg_obj_t *printcat = NULL;
const cfg_obj_t *printsev = NULL;
const cfg_obj_t *printtime = NULL;
+ const cfg_obj_t *buffered = NULL;
(void)cfg_map_get(channel, "print-category", &printcat);
(void)cfg_map_get(channel, "print-severity", &printsev);
(void)cfg_map_get(channel, "print-time", &printtime);
+ (void)cfg_map_get(channel, "buffered", &buffered);
if (printcat != NULL && cfg_obj_asboolean(printcat))
flags |= ISC_LOG_PRINTCATEGORY;
flags |= ISC_LOG_PRINTTIME;
if (printsev != NULL && cfg_obj_asboolean(printsev))
flags |= ISC_LOG_PRINTLEVEL;
+ if (buffered != NULL && cfg_obj_asboolean(buffered))
+ flags |= ISC_LOG_BUFFERED;
}
level = ISC_LOG_INFO;
};
category default { default_log; default_debug; };
category lame-servers { null; };
+
+ channel query_log {
+ file "query_log";
+ print-time yes;
+ buffered yes;
+ };
+ category queries { query_log; };
};
controls {
[ <command>print-category</command> <option>yes</option> or <option>no</option>; ]
[ <command>print-severity</command> <option>yes</option> or <option>no</option>; ]
[ <command>print-time</command> <option>yes</option> or <option>no</option>; ]
+ [ <command>buffered</command> <option>yes</option> or <option>no</option>; ]
}; ]
[ <command>category</command> <replaceable>category_name</replaceable> {
<replaceable>channel_name</replaceable> ; [ <replaceable>channel_name</replaceable> ; ... ]
<computeroutput>28-Feb-2000 15:05:32.863 general: notice: running</computeroutput>
</para>
+ <para>
+ If <command>buffered</command> has been turned on the output
+ to files will not be flushed after each log entry. By default
+ all log messages are flushed.
+ </para>
+
<para>
There are four predefined channels that are used for
<command>named</command>'s default logging as follows.
<filename>named.conf</filename>. [RT #35857]
</para>
</listitem>
+ <listitem>
+ <para>
+ Log output to files can now be buffered by specifying
+ <command>buffered yes;</command> when creating a channel.
+ </para>
+ </listitem>
</itemizedlist>
</sect2>
<sect2 id="relnotes_changes">
#define ISC_LOG_PRINTTAG 0x0010 /* tag and ":" */
#define ISC_LOG_PRINTPREFIX 0x0020 /* tag only, no colon */
#define ISC_LOG_PRINTALL 0x003F
+#define ISC_LOG_BUFFERED 0x0040
#define ISC_LOG_DEBUGONLY 0x1000
#define ISC_LOG_OPENERR 0x8000 /* internal */
/*@}*/
* call by defining a new channel and then calling isc_log_usechannel()
* for #ISC_LOGCATEGORY_DEFAULT.)
*
- *\li Specifying #ISC_LOG_PRINTTIME or #ISC_LOG_PRINTTAG for syslog is allowed,
- * but probably not what you wanted to do.
+ *\li Specifying #ISC_LOG_PRINTTIME or #ISC_LOG_PRINTTAG for syslog is
+ * allowed, but probably not what you wanted to do.
*
* #ISC_LOG_DEBUGONLY will mark the channel as usable only when the
* debug level of the logging context (see isc_log_setdebuglevel)
*
*\li level is >= #ISC_LOG_CRITICAL (the most negative logging level).
*
- *\li flags does not include any bits aside from the ISC_LOG_PRINT* bits
- * or #ISC_LOG_DEBUGONLY.
+ *\li flags does not include any bits aside from the ISC_LOG_PRINT* bits,
+ * #ISC_LOG_DEBUGONLY or #ISC_LOG_BUFFERED.
*
* Ensures:
*\li #ISC_R_SUCCESS
{
isc_logchannel_t *channel;
isc_mem_t *mctx;
+ unsigned int permitted = ISC_LOG_PRINTALL | ISC_LOG_DEBUGONLY |
+ ISC_LOG_BUFFERED;
REQUIRE(VALID_CONFIG(lcfg));
REQUIRE(name != NULL);
type == ISC_LOG_TOFILEDESC || type == ISC_LOG_TONULL);
REQUIRE(destination != NULL || type == ISC_LOG_TONULL);
REQUIRE(level >= ISC_LOG_CRITICAL);
- REQUIRE((flags &
- (unsigned int)~(ISC_LOG_PRINTALL | ISC_LOG_DEBUGONLY)) == 0);
+ REQUIRE((flags & ~permitted) == 0);
/* XXXDCL find duplicate names? */
struct stat statbuf;
isc_boolean_t matched = ISC_FALSE;
isc_boolean_t printtime, printtag, printcolon;
- isc_boolean_t printcategory, printmodule, printlevel;
+ isc_boolean_t printcategory, printmodule, printlevel, buffered;
isc_logconfig_t *lcfg;
isc_logchannel_t *channel;
isc_logchannellist_t *category_channels;
!= 0);
printlevel = ISC_TF((channel->flags & ISC_LOG_PRINTLEVEL)
!= 0);
+ buffered = ISC_TF((channel->flags & ISC_LOG_BUFFERED)
+ != 0);
switch (channel->type) {
case ISC_LOG_TOFILE:
printlevel ? level_string : "",
lctx->buffer);
- fflush(FILE_STREAM(channel));
+ if (!buffered)
+ fflush(FILE_STREAM(channel));
/*
* If the file now exceeds its maximum size
{ "print-time", &cfg_type_boolean, 0 },
{ "print-severity", &cfg_type_boolean, 0 },
{ "print-category", &cfg_type_boolean, 0 },
+ { "buffered", &cfg_type_boolean, 0 },
{ NULL, NULL, 0 }
};
static cfg_clausedef_t *