#include <LogObject.h>
Inherits RefCountObj.
Inherited by TextLogObject.
Public Types | |
enum | LogObjectFlags { BINARY = 1, REMOTE_DATA = 2, WRITES_TO_PIPE = 4, LOG_OBJECT_FMT_TIMESTAMP = 8 } |
Public Member Functions | |
LogObject (const LogFormat *format, const char *log_dir, const char *basename, LogFileFormat file_format, const char *header, Log::RollingEnabledValues rolling_enabled, int flush_threads, int rolling_interval_sec=0, int rolling_offset_hr=0, int rolling_size_mb=0, bool auto_created=false) TS_NONNULL(2) | |
LogObject (LogObject &) | |
virtual | ~LogObject () |
void | add_filter (LogFilter *filter, bool copy=true) |
void | set_filter_list (const LogFilterList &list, bool copy=true) |
void | add_loghost (LogHost *host, bool copy=true) |
void | set_remote_flag () |
void | set_fmt_timestamps () |
int | log (LogAccess *lad, const char *text_entry=NULL) |
int | va_log (LogAccess *lad, const char *fmt, va_list ap) |
unsigned | roll_files (long time_now=0) |
int | add_to_flush_queue (LogBuffer *buffer) |
size_t | preproc_buffers (int idx=-1) |
void | check_buffer_expiration (long time_now) |
void | display (FILE *fd=stdout) |
void | displayAsXML (FILE *fd=stdout, bool extended=false) |
const char * | get_original_filename () const |
const char * | get_full_filename () const |
const char * | get_base_filename () const |
off_t | get_file_size_bytes () |
uint64_t | get_signature () const |
int | get_rolling_interval () const |
void | set_log_file_header (const char *header) |
void | set_rolling_enabled (Log::RollingEnabledValues rolling_enabled) |
void | set_rolling_interval_sec (int rolling_interval_sec) |
void | set_rolling_offset_hr (int rolling_offset_hr) |
void | set_rolling_size_mb (int rolling_size_mb) |
bool | is_collation_client () const |
bool | receives_remote_data () const |
bool | writes_to_pipe () const |
bool | writes_to_disk () |
unsigned int | get_flags () const |
void | rename (char *new_name) |
bool | has_alternate_name () const |
const char * | get_format_string () |
void | force_new_buffer () |
bool | operator== (LogObject &rhs) |
int | do_filesystem_checks () |
Static Public Member Functions | |
static uint64_t | compute_signature (LogFormat *format, char *filename, unsigned int flags) |
Data Fields | |
bool | m_auto_created |
LogFormat * | m_format |
Ptr< LogFile > | m_logFile |
LogFilterList | m_filter_list |
LogHostList | m_host_list |
Definition at line 87 of file LogObject.h.
Definition at line 90 of file LogObject.h.
LogObject::LogObject | ( | const LogFormat * | format, | |
const char * | log_dir, | |||
const char * | basename, | |||
LogFileFormat | file_format, | |||
const char * | header, | |||
Log::RollingEnabledValues | rolling_enabled, | |||
int | flush_threads, | |||
int | rolling_interval_sec = 0 , |
|||
int | rolling_offset_hr = 0 , |
|||
int | rolling_size_mb = 0 , |
|||
bool | auto_created = false | |||
) |
Definition at line 88 of file LogObject.cc.
References compute_signature(), Log::config, Debug, ink_assert, LOG_FILE_BINARY, LOG_FILE_PIPE, LogObject(), m_format, and m_logFile.
Referenced by LogObject().
LogObject::LogObject | ( | LogObject & | rhs | ) |
Definition at line 138 of file LogObject.cc.
References add_filter(), add_loghost(), Log::config, Debug, LogHostList::first(), LogFilterList::first(), ink_assert, LogObject(), m_filter_list, m_format, m_host_list, m_logFile, LogHostList::next(), and LogFilterList::next().
LogObject::~LogObject | ( | ) | [virtual] |
Definition at line 179 of file LogObject.cc.
References ats_free(), LogHostList::clear(), LogHostList::count(), Debug, is_collation_client(), m_format, m_host_list, and preproc_buffers().
void LogObject::add_filter | ( | LogFilter * | filter, | |
bool | copy = true | |||
) |
Definition at line 285 of file LogObject.cc.
References LogFilterList::add(), and m_filter_list.
Referenced by LogObject().
void LogObject::add_loghost | ( | LogHost * | host, | |
bool | copy = true | |||
) |
Definition at line 308 of file LogObject.cc.
References LogHostList::add(), Ptr< T >::clear(), m_host_list, and m_logFile.
Referenced by LogObject().
int LogObject::add_to_flush_queue | ( | LogBuffer * | buffer | ) | [inline] |
Definition at line 124 of file LogObject.h.
References LogBufferManager::add_to_flush_queue().
void LogObject::check_buffer_expiration | ( | long | time_now | ) |
Definition at line 802 of file LogObject.cc.
References LogBuffer::expiration_time(), and force_new_buffer().
uint64_t LogObject::compute_signature | ( | LogFormat * | format, | |
char * | filename, | |||
unsigned int | flags | |||
) | [static] |
Definition at line 327 of file LogObject.cc.
References ats_free(), ats_malloc(), BINARY, LogFormat::fieldlist(), ats::CryptoHash::fold(), ink_string_concatenate_strings(), LogFormat::printf_str(), and WRITES_TO_PIPE.
Referenced by LogObject().
void LogObject::display | ( | FILE * | fd = stdout |
) |
Definition at line 351 of file LogObject.cc.
References LogFilterList::display(), LogHostList::display(), get_full_filename(), is_collation_client(), m_filter_list, m_format, m_host_list, and LogFormat::name().
void LogObject::displayAsXML | ( | FILE * | fd = stdout , |
|
bool | extended = false | |||
) |
Definition at line 368 of file LogObject.cc.
References BINARY, LogFilterList::display_as_XML(), LogFormat::displayAsXML(), LogHostList::first(), LogFilterList::first(), m_filter_list, m_format, m_host_list, LogHost::name(), LogFormat::name(), LogHostList::next(), and LogFilterList::next().
int LogObject::do_filesystem_checks | ( | ) |
Definition at line 814 of file LogObject.cc.
References LogHostList::do_filesystem_checks(), m_host_list, and m_logFile.
void LogObject::force_new_buffer | ( | ) | [inline] |
Definition at line 199 of file LogObject.h.
Referenced by check_buffer_expiration(), and LogObjectManager::unmanage_api_object().
const char* LogObject::get_base_filename | ( | ) | const [inline] |
Definition at line 156 of file LogObject.h.
Referenced by LogBuffer::LogBuffer(), and LogObjectManager::transfer_objects().
off_t LogObject::get_file_size_bytes | ( | ) | [inline] |
Definition at line 387 of file LogObject.h.
References LogHostList::first(), LogHost::get_orphan_logfile(), LogFile::get_size_bytes(), m_host_list, m_logFile, and LogHostList::next().
Referenced by roll_files().
unsigned int LogObject::get_flags | ( | ) | const [inline] |
Definition at line 191 of file LogObject.h.
const char* LogObject::get_format_string | ( | ) | [inline] |
Definition at line 197 of file LogObject.h.
References LogFormat::format_string(), and m_format.
const char* LogObject::get_full_filename | ( | ) | const [inline] |
Definition at line 155 of file LogObject.h.
Referenced by display().
const char* LogObject::get_original_filename | ( | ) | const [inline] |
Definition at line 154 of file LogObject.h.
int LogObject::get_rolling_interval | ( | ) | const [inline] |
Definition at line 162 of file LogObject.h.
uint64_t LogObject::get_signature | ( | ) | const [inline] |
Definition at line 160 of file LogObject.h.
Referenced by LogObjectManager::get_object_with_signature(), and operator==().
bool LogObject::has_alternate_name | ( | ) | const [inline] |
Definition at line 195 of file LogObject.h.
bool LogObject::is_collation_client | ( | ) | const [inline] |
Definition at line 186 of file LogObject.h.
References m_logFile.
Referenced by display(), LogObjectManager::open_local_pipes(), operator==(), and ~LogObject().
int LogObject::log | ( | LogAccess * | lad, | |
const char * | text_entry = NULL | |||
) |
Definition at line 543 of file LogObject.cc.
References LogBuffer::checkin_write(), Log::config, Debug, LogFormat::field_count(), LogFieldList::first(), ink_assert, ink_strlcpy(), LogFormat::is_aggregate(), LogField::is_time_field(), LogFormat::m_agg_marshal_space, LogFormat::m_field_list, m_filter_list, m_format, LogFormat::m_interval_next, LogFormat::m_interval_sec, m_logFile, LogFieldList::marshal(), LogFieldList::marshal_agg(), LogFieldList::marshal_len(), LogFieldList::next(), Note, LogAccess::strlen(), LogUtils::timestamp(), LogFilterList::toss_this_entry(), LogField::update_aggregate(), val, LogFilterList::wipe_this_entry(), and writes_to_pipe().
Referenced by va_log().
bool LogObject::operator== | ( | LogObject & | rhs | ) | [inline] |
Definition at line 371 of file LogObject.h.
References get_signature(), is_collation_client(), m_filter_list, m_host_list, m_logFile, and receives_remote_data().
size_t LogObject::preproc_buffers | ( | int | idx = -1 |
) | [inline] |
Definition at line 133 of file LogObject.h.
References m_host_list, m_logFile, and LogBufferManager::preproc_buffers().
Referenced by ~LogObject().
bool LogObject::receives_remote_data | ( | ) | const [inline] |
void LogObject::rename | ( | char * | new_name | ) |
Definition at line 272 of file LogObject.cc.
References ats_free(), ats_strdup, and m_logFile.
unsigned LogObject::roll_files | ( | long | time_now = 0 |
) |
Definition at line 716 of file LogObject.cc.
References get_file_size_bytes(), Log::ROLL_ON_SIZE_ONLY, Log::ROLL_ON_TIME_AND_SIZE, Log::ROLL_ON_TIME_ONLY, LogUtils::seconds_to_next_roll(), should_roll_on_size(), should_roll_on_time(), and LogUtils::timestamp().
void LogObject::set_filter_list | ( | const LogFilterList & | list, | |
bool | copy = true | |||
) |
Definition at line 295 of file LogObject.cc.
References LogFilterList::add(), LogFilterList::clear(), LogFilterList::does_conjunction(), LogFilterList::first(), m_filter_list, LogFilterList::next(), and LogFilterList::set_conjunction().
void LogObject::set_fmt_timestamps | ( | ) | [inline] |
Definition at line 117 of file LogObject.h.
Referenced by LogConfig::init(), and TextLogObject::TextLogObject().
void LogObject::set_log_file_header | ( | const char * | header | ) | [inline] |
Definition at line 164 of file LogObject.h.
References m_logFile.
void LogObject::set_remote_flag | ( | ) | [inline] |
Definition at line 116 of file LogObject.h.
Referenced by Log::match_logobject().
void LogObject::set_rolling_enabled | ( | Log::RollingEnabledValues | rolling_enabled | ) | [inline] |
Definition at line 166 of file LogObject.h.
void LogObject::set_rolling_interval_sec | ( | int | rolling_interval_sec | ) | [inline] |
Definition at line 171 of file LogObject.h.
void LogObject::set_rolling_offset_hr | ( | int | rolling_offset_hr | ) | [inline] |
Definition at line 176 of file LogObject.h.
void LogObject::set_rolling_size_mb | ( | int | rolling_size_mb | ) | [inline] |
Definition at line 181 of file LogObject.h.
int LogObject::va_log | ( | LogAccess * | lad, | |
const char * | fmt, | |||
va_list | ap | |||
) |
Definition at line 512 of file LogObject.cc.
References ink_assert, log(), LOG_OBJECT_FMT_TIMESTAMP, LogUtils::timestamp(), and LogUtils::timestamp_to_str().
Referenced by Log::va_error(), and TextLogObject::va_write().
bool LogObject::writes_to_disk | ( | ) | [inline] |
Definition at line 189 of file LogObject.h.
References m_logFile, and WRITES_TO_PIPE.
bool LogObject::writes_to_pipe | ( | ) | const [inline] |
Definition at line 188 of file LogObject.h.
References WRITES_TO_PIPE.
Referenced by log(), and LogObjectManager::open_local_pipes().
Definition at line 207 of file LogObject.h.
Definition at line 210 of file LogObject.h.
Referenced by add_filter(), display(), displayAsXML(), log(), LogObject(), operator==(), and set_filter_list().
Definition at line 208 of file LogObject.h.
Referenced by Log::collate_thread_main(), display(), displayAsXML(), get_format_string(), log(), LogObject(), and ~LogObject().
Definition at line 211 of file LogObject.h.
Referenced by add_loghost(), display(), displayAsXML(), do_filesystem_checks(), get_file_size_bytes(), LogObject(), operator==(), preproc_buffers(), and ~LogObject().
Definition at line 209 of file LogObject.h.
Referenced by add_loghost(), do_filesystem_checks(), get_file_size_bytes(), is_collation_client(), log(), LogObject(), LogObjectManager::open_local_pipes(), operator==(), preproc_buffers(), rename(), set_log_file_header(), and writes_to_disk().