mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-04 07:55:18 +00:00
[3752] Add the immediate flush flag
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
|
// Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, and/or distribute this software for any
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
// purpose with or without fee is hereby granted, provided that the above
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -80,7 +80,8 @@ private:
|
|||||||
/// {
|
/// {
|
||||||
/// "output": "/var/log/kea-warn.log",
|
/// "output": "/var/log/kea-warn.log",
|
||||||
/// "maxver": 8,
|
/// "maxver": 8,
|
||||||
/// "maxsize": 204800
|
/// "maxsize": 204800,
|
||||||
|
/// "flush": ture
|
||||||
/// }
|
/// }
|
||||||
/// ],
|
/// ],
|
||||||
/// @param destination parsed parameters will be stored here
|
/// @param destination parsed parameters will be stored here
|
||||||
|
@@ -47,6 +47,13 @@
|
|||||||
"item_type": "integer",
|
"item_type": "integer",
|
||||||
"item_optional": true,
|
"item_optional": true,
|
||||||
"item_default": 204800
|
"item_default": 204800
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"item_name": "flush",
|
||||||
|
"item_type": "boolean",
|
||||||
|
"item_optional": true,
|
||||||
|
"item_default": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@@ -26,7 +26,8 @@ bool
|
|||||||
LoggingDestination::equals(const LoggingDestination& other) const {
|
LoggingDestination::equals(const LoggingDestination& other) const {
|
||||||
return (output_ == other.output_ &&
|
return (output_ == other.output_ &&
|
||||||
maxver_ == other.maxver_ &&
|
maxver_ == other.maxver_ &&
|
||||||
maxsize_ == other.maxsize_);
|
maxsize_ == other.maxsize_ &&
|
||||||
|
flush_ == other.flush_);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoggingInfo::LoggingInfo()
|
LoggingInfo::LoggingInfo()
|
||||||
@@ -134,6 +135,9 @@ LoggingInfo::toSpec() const {
|
|||||||
option.filename = dest->output_;
|
option.filename = dest->output_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy the immediate flush flag
|
||||||
|
option.flush = flush_;
|
||||||
|
|
||||||
// ... and set the destination
|
// ... and set the destination
|
||||||
spec.addOutputOption(option);
|
spec.addOutputOption(option);
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
|
// Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, and/or distribute this software for any
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
// purpose with or without fee is hereby granted, provided that the above
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -40,6 +40,9 @@ struct LoggingDestination {
|
|||||||
/// @brief Maximum log file size
|
/// @brief Maximum log file size
|
||||||
uint64_t maxsize_;
|
uint64_t maxsize_;
|
||||||
|
|
||||||
|
/// @brief Immediate flush
|
||||||
|
bool flush_;
|
||||||
|
|
||||||
/// @brief Compares two objects for equality.
|
/// @brief Compares two objects for equality.
|
||||||
///
|
///
|
||||||
/// @param other Object to be compared with this object.
|
/// @param other Object to be compared with this object.
|
||||||
@@ -49,7 +52,7 @@ struct LoggingDestination {
|
|||||||
|
|
||||||
/// @brief Default constructor.
|
/// @brief Default constructor.
|
||||||
LoggingDestination()
|
LoggingDestination()
|
||||||
: output_("stdout"), maxver_(1), maxsize_(204800) {
|
: output_("stdout"), maxver_(1), maxsize_(204800), flush_(true) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -63,7 +66,8 @@ struct LoggingDestination {
|
|||||||
/// {
|
/// {
|
||||||
/// "output": "/path/to/the/logfile.log",
|
/// "output": "/path/to/the/logfile.log",
|
||||||
/// "maxver": 8,
|
/// "maxver": 8,
|
||||||
/// "maxsize": 204800
|
/// "maxsize": 204800,
|
||||||
|
/// "flush": true
|
||||||
/// }
|
/// }
|
||||||
/// ],
|
/// ],
|
||||||
/// "severity": "WARN",
|
/// "severity": "WARN",
|
||||||
|
Reference in New Issue
Block a user