// All interfaces should be now active.
ASSERT_TRUE(test_config.socketOpen("eth0", AF_INET6));
ASSERT_TRUE(test_config.socketOpen("eth1", AF_INET6));
+
+ // Avoid log4cplus error message.
+ LogContentTest::reset();
}
// This test verifies that it is possible to select subset of interfaces
EXPECT_TRUE(test_config.socketOpen("eth0", AF_INET6));
// The 2001:db8:1::1 address on eth1 was selected.
EXPECT_TRUE(test_config.socketOpen("eth1", AF_INET6));
+
+ // Avoid log4cplus error message.
+ LogContentTest::reset();
}
// This test checks if it is possible to specify relay information
lexical_cast<string>(opt.maxver));
properties.setProperty("ImmediateFlush", opt.flush ? "true" : "false");
properties.setProperty("UseLockFile", "true");
- properties.setProperty("ReopenDelay", "0");
fileapp = log4cplus::SharedAppenderPtr(
new log4cplus::RollingFileAppender(properties));
}
-// Copyright (C) 2016-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
OutputOption option;
option.destination = OutputOption::DEST_FILE;
option.filename = string(LogContentTest::LOG_FILE);
- option.maxsize = 2000000000UL;
spec.addOutputOption(option);
LoggerManager manager;
manager.process(spec);
remFile();
}
+void LogContentTest::reset() {
+ // Reset to default (INFO) with output to stdout.
+ // To be used to avoid spurious error messages
+ // "log4cplus:ERROR file is not open: logtest.log".
+ LoggerSpecification spec(getRootLoggerName());
+ OutputOption option;
+ // Change the default to stdout.
+ option.stream = OutputOption::STR_STDOUT;
+ spec.addOutputOption(option);
+ LoggerManager manager;
+ manager.process(spec);
+}
+
bool LogContentTest::checkFile() {
ifstream file(LOG_FILE);
EXPECT_TRUE(file.is_open());
-// Copyright (C) 2016-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2025 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @brief remove the test log file
void remFile();
+ /// @brief reset the logger to INFO stdout.
+ void reset();
+
/// @brief Enables or disables verbose mode.
///
/// See @ref verbose_ for details.