wether to print or not the timestamp in the logging files.
Affected file lib/silcutil/silclog.[ch].
* Added silcd configuration option Timestamp in the Logging
section. Affected file silcd/serverconfig.[ch],
doc/example_silcd.conf.in.
+Mon Sep 2 23:00:30 CEST 2002 Johnny Mnemonic <johnny@themnemonic.org>
+
+ * Added global variable silc_log_timestamp that tells silclog
+ wether to print or not the timestamp in the logging files.
+ Affected file lib/silcutil/silclog.[ch].
+
+ * Added silcd configuration option Timestamp in the Logging
+ section. Affected file silcd/serverconfig.[ch],
+ doc/example_silcd.conf.in.
+
Fri Aug 30 08:57:33 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Fixed fingerprint checking to check for entirely empty
Fri Aug 30 08:57:33 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Fixed fingerprint checking to check for entirely empty
void silc_server_stop(SilcServer server)
{
void silc_server_stop(SilcServer server)
{
- SILC_LOG_DEBUG(("Stopping server"));
+ SILC_LOG_INFO(("SILC Server shutting down"));
if (server->schedule) {
int i;
if (server->schedule) {
int i;
{
SILC_SERVER_CONFIG_SECTION_INIT(SilcServerConfigLogging);
{
SILC_SERVER_CONFIG_SECTION_INIT(SilcServerConfigLogging);
- if (!strcmp(name, "quicklogs")) {
+ if (!strcmp(name, "timestamp")) {
+ config->logging_timestamp = *(bool *)val;
+ }
+ else if (!strcmp(name, "quicklogs")) {
config->logging_quick = *(bool *)val;
}
else if (!strcmp(name, "flushdelay")) {
config->logging_quick = *(bool *)val;
}
else if (!strcmp(name, "flushdelay")) {
};
static const SilcConfigTable table_logging[] = {
};
static const SilcConfigTable table_logging[] = {
+ { "timestamp", SILC_CONFIG_ARG_TOGGLE, fetch_logging, NULL },
{ "quicklogs", SILC_CONFIG_ARG_TOGGLE, fetch_logging, NULL },
{ "flushdelay", SILC_CONFIG_ARG_INT, fetch_logging, NULL },
{ "info", SILC_CONFIG_ARG_BLOCK, fetch_logging, table_logging_c },
{ "quicklogs", SILC_CONFIG_ARG_TOGGLE, fetch_logging, NULL },
{ "flushdelay", SILC_CONFIG_ARG_INT, fetch_logging, NULL },
{ "info", SILC_CONFIG_ARG_BLOCK, fetch_logging, table_logging_c },
if (!config_new)
return NULL;
if (!config_new)
return NULL;
+ /* general config defaults */
+ config_new->logging_timestamp = TRUE;
+
/* obtain a config file object */
file = silc_config_open(filename);
if (!file) {
/* obtain a config file object */
file = silc_config_open(filename);
if (!file) {
SILC_LOG_DEBUG(("Setting configured log file names and options"));
SILC_LOG_DEBUG(("Setting configured log file names and options"));
+ silc_log_timestamp = config->logging_timestamp;
silc_log_quick = config->logging_quick;
silc_log_flushdelay = (config->logging_flushdelay ?
config->logging_flushdelay :
silc_log_quick = config->logging_quick;
silc_log_flushdelay = (config->logging_flushdelay ?
config->logging_flushdelay :
SilcServerConfigConnParams param;
bool detach_disabled;
SilcUInt32 detach_timeout;
SilcServerConfigConnParams param;
bool detach_disabled;
SilcUInt32 detach_timeout;
+ bool logging_timestamp;
bool logging_quick;
long logging_flushdelay;
bool logging_quick;
long logging_flushdelay;
# The ServerInfo section is mandatory section. Other sections are optional.
# However, if General section is defined it must be defined before the
# ConnectionParams sections. On the other hand, the ConnectionParams section
# The ServerInfo section is mandatory section. Other sections are optional.
# However, if General section is defined it must be defined before the
# ConnectionParams sections. On the other hand, the ConnectionParams section
-# must be defined before Client, ServerConnection or RouterConnection
+# must be defined before Client, ServerConnection or RouterConnection
# sections. Other sections can be in free order.
#
#
# sections. Other sections can be in free order.
#
#
-# Include global algorithms from the "silcalgs.conf" file. This file
-# defines ciphers, hash functions, HMACs and PKCS algorithms that can
-# be used.
+# Include global algorithms from the "silcalgs.conf" file. This file defines
+# ciphers, hash functions, HMACs and PKCS algorithms that can be used.
#
Include "@ETCDIR@/silcalgs.conf";
#
Include "@ETCDIR@/silcalgs.conf";
#prefer_passphrase_auth = true;
# Set this to true if the server should require fully qualified
#prefer_passphrase_auth = true;
# Set this to true if the server should require fully qualified
- # domain names (FQDN) for incoming connections. If true, a host
+ # domain names (FQDN) for incoming connections. If true, a host
# without FQDN cannot connect to the server.
#require_reverse_lookup = true;
# without FQDN cannot connect to the server.
#require_reverse_lookup = true;
# Maximum number of incoming connections allowed per single host.
# For example, if this is one (1) it means a host can link only
# Maximum number of incoming connections allowed per single host.
# For example, if this is one (1) it means a host can link only
- # once to the server. Attempting to connect more than once would be
- # refused. This can be overridden with ConnectionParams.
+ # once to the server. Attempting to connect more than once would
+ # be refused. This can be overridden with ConnectionParams.
#connections_max_per_host = 10;
#connections_max_per_host = 10;
- # Required version of the remote. If these are specified then the
- # remote must be of at least this version, or newer. If older then
- # the connection will not be allowed.
+ # Required version of the remote side. If these are specified then
+ # the remote must be of at least this version, or newer. If older
+ # then the connection will not be allowed.
#
# version_protocol - SILC protocol version ("major.minor")
# version_software - software version ("major.minor")
#
# version_protocol - SILC protocol version ("major.minor")
# version_software - software version ("major.minor")
#version_software = "1.3";
#version_software_vendor = "SomeVendor";
#version_software = "1.3";
#version_software_vendor = "SomeVendor";
- # Default keepalive frequency (seconds). This can be overridden
+ # Default keepalive frequency (seconds). This can be overridden with
# with ConnectionParams.
keepalive_secs = 300;
# with ConnectionParams.
keepalive_secs = 300;
# reconnect_interval_max - maximum interval for reconnect, the
# server never waits longer than this to
# reconnect (seconds).
# reconnect_interval_max - maximum interval for reconnect, the
# server never waits longer than this to
# reconnect (seconds).
- # reconnect_keep_trying - whether to keep trying even after
+ # reconnect_keep_trying - whether to keep trying even after
# reconnect_count is reached (the interval
# will be reconnect_interval_max).
#
# reconnect_count is reached (the interval
# will be reconnect_interval_max).
#
reconnect_interval_max = 600;
reconnect_keep_trying = true;
reconnect_interval_max = 600;
reconnect_keep_trying = true;
- # Key exchange protocol rekey interval (seconds). How often to
- # regenerate the session key with the remote. Initiator will perform
+ # Key exchange protocol rekey interval (seconds). How often to
+ # regenerate the session key with the remote. Initiator will perform
# the rekey and this setting affects only when connecting as initiator.
# This can be overridden with ConnectionParams.
#key_exchange_rekey = 3600;
# the rekey and this setting affects only when connecting as initiator.
# This can be overridden with ConnectionParams.
#key_exchange_rekey = 3600;
- # Key exchange with Perfect Forward Secrecy (PFS). This will perform
+ # Key exchange with Perfect Forward Secrecy (PFS). This will perform
# the rekey process with PFS, making the new key more secure since it
# the rekey process with PFS, making the new key more secure since it
- # is not dependent in any way of the old key. This will make the rekey
+ # is not dependent in any way of the old key. This will make the rekey
# process somewhat slower, than without PFS. This can be overridden
# with ConnectionParams.
#key_exchange_pfs = true;
# process somewhat slower, than without PFS. This can be overridden
# with ConnectionParams.
#key_exchange_pfs = true;
- # Key exchange timeout (seconds). If the key exchange protocol is not
+ # Key exchange timeout (seconds). If the key exchange protocol is not
# finished in this time period the remote connection will be closed.
#key_exchange_timeout = 60;
# finished in this time period the remote connection will be closed.
#key_exchange_timeout = 60;
- # Connection authentication timeout (seconds). If the connection
+ # Connection authentication timeout (seconds). If the connection
# authentication protocol is not finished in this time period the
# remote connection will be closed.
#conn_auth_timeout = 60;
# authentication protocol is not finished in this time period the
# remote connection will be closed.
#conn_auth_timeout = 60;
- # Channel key rekey interval (seconds). How often channel key is
- # regenerated. Note that channel key is regenerated also always when
- # someone joins or leaves the channel.
+ # Channel key rekey interval (seconds). How often channel key is
+ # regenerated. Note that channel key is regenerated also always when
+ # someone joins or leaves the channel.
#channel_rekey_secs = 3600;
# SILC session detachment disabling and limiting. By default clients
# can detach their sessions from server. If you set detach_disabled
#channel_rekey_secs = 3600;
# SILC session detachment disabling and limiting. By default clients
# can detach their sessions from server. If you set detach_disabled
- # to true the DETACH command cannot be used by clients. If you
- # want to limit for how long the server keeps detached sessions you
- # can set the time (minutes) in detach_timeout. After that timeout
- # the detached session is closed if it is not resumed. By default
+ # to true the DETACH command cannot be used by clients. If you want
+ # to limit for how long the server keeps detached sessions you can
+ # set the time (minutes) in detach_timeout. After that timeout the
+ # detached session is closed if it is not resumed. By default
# sessions are persistent as long as server is running.
#detach_disabled = true;
#detach_timeout = 1440;
# sessions are persistent as long as server is running.
#detach_disabled = true;
#detach_timeout = 1440;
AdminEmail = "foo-admin@bar.com";
#
AdminEmail = "foo-admin@bar.com";
#
- # Run SILC server as specific user and group. The server must be
+ # Run SILC server as specific user and group. The server must be
# initially run as root.
#
User = "nobody";
# initially run as root.
#
User = "nobody";
# and "Fatals"
#
Logging {
# and "Fatals"
#
Logging {
+ # Use timestamp in the logging files? (Usually it is a good idea,
+ # but you may want to disable this if you run silcd under some
+ # daemontool).
+ Timestamp = true;
+
# If QuickLogs is true, then the logging files will be updated
# If QuickLogs is true, then the logging files will be updated
- # real-time. This causes a bit more CPU and HDD activity, but
+ # real-time. This causes a bit more CPU and HDD activity, but
# reduces memory usage. By default it is false and log files are
# written with FlushDelay timeout.
#
#QuickLogs = true;
# reduces memory usage. By default it is false and log files are
# written with FlushDelay timeout.
#
#QuickLogs = true;
- # FlushDelay tells log files update delay (seconds) in case you
+ # FlushDelay tells log files update delay (seconds) in case you
# have chosen buffering output. This setting has effect only if
# the QuickLogs is false.
#
# have chosen buffering output. This setting has effect only if
# the QuickLogs is false.
#
# ConnectionParams blocks defined.
#
ConnectionParams {
# ConnectionParams blocks defined.
#
ConnectionParams {
- # unique name. The name is used to reference to this parameter
- # block from the connections. This field is mandatory.
+ # unique name. The name is used to reference to this parameter
+ # block from the connections. This field is mandatory.
- # Maximum number of connections allowed. More connections will be
- # refused. This can be used for example to limit number of clients.
+ # Maximum number of connections allowed. More connections will be
+ # refused. This can be used for example to limit number of clients.
# Note that this never can be larger than the connections_max
# specified in General section.
connections_max = 200;
# Note that this never can be larger than the connections_max
# specified in General section.
connections_max = 200;
- # Maximum number of connections allowed per host. For example, if
+ # Maximum number of connections allowed per host. For example, if
# this is one (1) it means a host can link only once to the server.
# Attempting to link more than once would be refused.
#
# this is one (1) it means a host can link only once to the server.
# Attempting to link more than once would be refused.
#
# connections it is recommended that this value is set to one (1).
connections_max_per_host = 10;
# connections it is recommended that this value is set to one (1).
connections_max_per_host = 10;
- # Required version of the remote. If these are specified then the
- # remote must be of at least this version, or newer. If older then
- # the connection will not be allowed.
+ # Required version of the remote side. If these are specified then
+ # the remote must be of at least this version, or newer. If older
+ # then the connection will not be allowed.
- # version_protocol - SILC protocol version
- # version_software - software version
+ # version_protocol - SILC protocol version ("major.minor")
+ # version_software - software version ("major.minor")
# version_software_vendor - vendor specific version extension
#
# The version_software_vendor may be for example a string or a build
# number of the software. The string can be a regex string to match
# more widely. Usually the vendor version checking is not necessary
# version_software_vendor - vendor specific version extension
#
# The version_software_vendor may be for example a string or a build
# number of the software. The string can be a regex string to match
# more widely. Usually the vendor version checking is not necessary
+ # and can be omitted. These can be overridden with ConnectionParams.
#version_protocol = "1.1";
#version_software = "1.3";
#version_software_vendor = "SomeVendor";
#version_protocol = "1.1";
#version_software = "1.3";
#version_software_vendor = "SomeVendor";
# reconnect_interval_max - maximum interval for reconnect, the
# server never waits longer than this to
# reconnect (seconds).
# reconnect_interval_max - maximum interval for reconnect, the
# server never waits longer than this to
# reconnect (seconds).
- # reconnect_keep_trying - whether to keep trying even after
+ # reconnect_keep_trying - whether to keep trying even after
# reconnect_count is reached (the interval
# will be reconnect_interval_max).
reconnect_count = 7;
# reconnect_count is reached (the interval
# will be reconnect_interval_max).
reconnect_count = 7;
reconnect_interval_max = 600;
reconnect_keep_trying = true;
reconnect_interval_max = 600;
reconnect_keep_trying = true;
- # Key exchange protocol rekey interval (seconds). How often to
- # regenerate the session key with the remote. Initiator will perform
+ # Key exchange protocol rekey interval (seconds). How often to
+ # regenerate the session key with the remote. Initiator will perform
# the rekey and this setting affects only when connecting as initiator.
#key_exchange_rekey = 3600;
# the rekey and this setting affects only when connecting as initiator.
#key_exchange_rekey = 3600;
# If both are provided then both password and public key based authentication
# is allowed. If the Publickey is used it includes the file path to the
# public key file. If none of them is provided then authentication is not
# If both are provided then both password and public key based authentication
# is allowed. If the Publickey is used it includes the file path to the
# public key file. If none of them is provided then authentication is not
-# required. The PublicKey can be set multiple times to set multiple
+# required. The PublicKey can be set multiple times to set multiple
# public keys for one connection.
#
# Next example connection will match to all incoming client connections,
# public keys for one connection.
#
# Next example connection will match to all incoming client connections,
# required.
#
# If the connection is backup connection then set the "Backup" option
# required.
#
# If the connection is backup connection then set the "Backup" option
-# to true. For normal connections set it false. If it is set to true then
+# to true. For normal connections set it false. If it is set to true then
# your server will be backup router.
#
ServerConnection {
# your server will be backup router.
#
ServerConnection {
# If the connection is backup router connection then set the "BackupHost"
# option to the IP address of the router that the backup router will
# replace if it becomes unavailable. Set also the router's port to the
# If the connection is backup router connection then set the "BackupHost"
# option to the IP address of the router that the backup router will
# replace if it becomes unavailable. Set also the router's port to the
-# "BackupPort" option. For normal connection leave both commented. If this
+# "BackupPort" option. For normal connection leave both commented. If this
# backup router is in our cell then set the "BackupLocal" option to true.
# If the backup router is in other cell then set it to false.
#
# backup router is in our cell then set the "BackupLocal" option to true.
# If the backup router is in other cell then set it to false.
#
#
# These connections are denied to connect to our server.
#
#
# These connections are denied to connect to our server.
#
-# The "Reason" field is mandatory, while the "Host" field can be omitted to
+# The "Reason" field is mandatory, while the "Host" field can be omitted to
# match everything.
#
#Deny {
# match everything.
#
#Deny {
{"", NULL, 0, "Fatal", SILC_LOG_FATAL, NULL, NULL},
};
{"", NULL, 0, "Fatal", SILC_LOG_FATAL, NULL, NULL},
};
+/* Causes logging output to contain timestamps */
+bool silc_log_timestamp = TRUE;
+
/* If TRUE, log files will be flushed for each log input */
bool silc_log_quick = FALSE;
/* If TRUE, log files will be flushed for each log input */
bool silc_log_quick = FALSE;
- fprintf(fp, "[%s] [%s] %s\n", silc_get_time(), typename, string);
+ /* writes the logging string to the selected channel */
+ if (silc_log_timestamp)
+ fprintf(fp, "[%s] [%s] %s\n", silc_get_time(), typename, string);
+ else
+ fprintf(fp, "[%s] %s\n", typename, string);
+
if (silc_log_quick || silc_log_starting) {
fflush(fp);
if (log) /* we may have been redirected to stderr */
if (silc_log_quick || silc_log_starting) {
fflush(fp);
if (log) /* we may have been redirected to stderr */
+/****v* silcutil/SilcLogAPI/silc_log_timestamp
+ *
+ * NAME
+ *
+ * bool silc_log_timestamp -- enable/disable fast logging timestamp
+ *
+ * DESCRIPTION
+ *
+ * Causes SilcLog to add a timestamp as returned by silc_get_time().
+ * This may be useful for example if you run your application under a
+ * daemon helper like watchdog that adds its own timestamp. Defaults to
+ * true.
+ *
+ ***/
+extern DLLAPI bool silc_log_timestamp;
+
/****v* silcutil/SilcLogAPI/silc_log_quick
*
* NAME
/****v* silcutil/SilcLogAPI/silc_log_quick
*
* NAME