17 #ifndef __SLAVE_CONTAINER_LOGGER_LIB_LOGROTATE_HPP__ 18 #define __SLAVE_CONTAINER_LOGGER_LIB_LOGROTATE_HPP__ 41 class LogrotateContainerLoggerProcess;
54 "Maximum size, in bytes, of a single stdout log file.\n" 55 "Defaults to 10 MB. Must be at least 1 (memory) page.",
60 "logrotate_stdout_options",
61 "Additional config options to pass into 'logrotate' for stdout.\n" 62 "This string will be inserted into a 'logrotate' configuration file.\n" 64 " /path/to/stdout {\n" 65 " <logrotate_stdout_options>\n" 66 " size <max_stdout_size>\n" 68 "NOTE: The 'size' option will be overridden by this module.");
72 "Maximum size, in bytes, of a single stderr log file.\n" 73 "Defaults to 10 MB. Must be at least 1 (memory) page.",
78 "logrotate_stderr_options",
79 "Additional config options to pass into 'logrotate' for stderr.\n" 80 "This string will be inserted into a 'logrotate' configuration file.\n" 82 " /path/to/stderr {\n" 83 " <logrotate_stderr_options>\n" 84 " size <max_stderr_size>\n" 86 "NOTE: The 'size' option will be overridden by this module.");
93 "Expected --max_stdout_size and --max_stderr_size of " 113 "environment_variable_prefix",
114 "Prefix for environment variables meant to modify the behavior of\n" 115 "the logrotate logger for the specific container being launched.\n" 116 "The logger will look for four prefixed environment variables in the\n" 117 "container's 'CommandInfo's 'Environment':\n" 118 " * MAX_STDOUT_SIZE\n" 119 " * LOGROTATE_STDOUT_OPTIONS\n" 120 " * MAX_STDERR_SIZE\n" 121 " * LOGROTATE_STDERR_OPTIONS\n" 122 "If present, these variables will overwrite the global values set\n" 123 "via module parameters.",
124 "CONTAINER_LOGGER_");
128 "Directory path of Mesos binaries. The logrotate container logger\n" 130 "binary file under this directory.",
133 std::string executablePath =
137 return Error(
"Cannot find: " + executablePath);
145 "If specified, the logrotate container logger will use the specified\n" 146 "'logrotate' instead of the system's 'logrotate'.",
156 "Failed to check logrotate: " + helpCommand.
error());
163 "libprocess_num_worker_threads",
164 "Number of Libprocess worker threads.\n" 165 "Defaults to 8. Must be at least 1.",
170 "Expected --libprocess_num_worker_threads of at least 1");
201 const ContainerID& containerId,
202 const mesos::slave::ContainerConfig& containerConfig)
override;
213 #endif // __SLAVE_CONTAINER_LOGGER_LIB_LOGROTATE_HPP__ bool exists(const std::string &path)
Definition: exists.hpp:26
Definition: errorbase.hpp:36
static Option< Error > validateSize(const Bytes &value)
Definition: lib_logrotate.hpp:89
std::string logrotate_path
Definition: lib_logrotate.hpp:180
Definition: lib_logrotate.hpp:190
size_t pagesize()
Definition: pagesize.hpp:24
constexpr Bytes Megabytes(uint64_t value)
Definition: bytes.hpp:123
const std::string NAME
Definition: logrotate.hpp:38
std::string join(const std::string &path1, const std::string &path2, const char _separator=os::PATH_SEPARATOR)
Definition: path.hpp:116
size_t libprocess_num_worker_threads
Definition: lib_logrotate.hpp:182
Option< std::string > logrotate_stderr_options
Definition: lib_logrotate.hpp:104
process::Owned< LogrotateContainerLoggerProcess > process
Definition: lib_logrotate.hpp:206
Try< Nothing > initialize(const Flags &flags)
Initialized state for support of systemd functions in this file.
Bytes max_stdout_size
Definition: lib_logrotate.hpp:100
static Try error(const E &e)
Definition: try.hpp:43
Try< std::string > shell(const std::string &fmt, const T &...t)
Definition: shell.hpp:49
Definition: attributes.hpp:24
bool isError() const
Definition: try.hpp:78
LoggerFlags()
Definition: lib_logrotate.hpp:50
Flags()
Definition: lib_logrotate.hpp:110
Flags flags
Definition: lib_logrotate.hpp:205
constexpr char DEV_NULL[]
Definition: constants.hpp:30
uint64_t bytes() const
Definition: bytes.hpp:79
Option< std::string > logrotate_stdout_options
Definition: lib_logrotate.hpp:101
void add(T1 Flags::*t1, const Name &name, const Option< Name > &alias, const std::string &help, const T2 *t2, F validate)
Definition: flags.hpp:333
Definition: module.hpp:54
A containerizer component used to manage container logs.
Definition: container_logger.hpp:61
Try< std::string > prepare(const std::string &baseHierarchy, const std::string &subsystem, const std::string &cgroup)
Definition: lib_logrotate.hpp:48
std::string environment_variable_prefix
Definition: lib_logrotate.hpp:177
Definition: lib_logrotate.hpp:108
std::string stringify(int flags)
std::string launcher_dir
Definition: lib_logrotate.hpp:179
Bytes max_stderr_size
Definition: lib_logrotate.hpp:103
Definition: future.hpp:58