syslog-ng source
logrotate.c File Reference
#include "logrotate.h"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <time.h>
#include "messages.h"
Include dependency graph for logrotate.c:

Macros

#define LR_DEFAULT_SIZE   1000000
 
#define LR_DEFAULT_ROTATIONS   1
 

Functions

void logrotate_options_defaults (LogRotateOptions *logrotate_options)
 
gboolean logrotate_is_enabled (LogRotateOptions *logrotate_options)
 
gboolean logrotate_is_required (LogRotateOptions *logrotate_options, const gsize filesize)
 
gboolean logrotate_is_pending (LogRotateOptions *logrotate_options)
 
gchar * get_log_file_name (const gchar *filename, gsize rotation_suffix)
 
gsize first_log_file_to_rotate (const gchar *filename, gsize max_rotations)
 
gint rotate_log_file (const gchar *filename, gsize roation_suffix, gsize max_rotations)
 
LogRotateStatus logrotate_do_rotate (LogRotateOptions *logrotate_options, const gchar *filename)
 

Macro Definition Documentation

◆ LR_DEFAULT_ROTATIONS

#define LR_DEFAULT_ROTATIONS   1

◆ LR_DEFAULT_SIZE

#define LR_DEFAULT_SIZE   1000000

Function Documentation

◆ first_log_file_to_rotate()

gsize first_log_file_to_rotate ( const gchar *  filename,
gsize  max_rotations 
)

◆ get_log_file_name()

gchar* get_log_file_name ( const gchar *  filename,
gsize  rotation_suffix 
)

◆ logrotate_do_rotate()

LogRotateStatus logrotate_do_rotate ( LogRotateOptions logrotate_options,
const gchar *  filename 
)

◆ logrotate_is_enabled()

gboolean logrotate_is_enabled ( LogRotateOptions logrotate_options)

◆ logrotate_is_pending()

gboolean logrotate_is_pending ( LogRotateOptions logrotate_options)

◆ logrotate_is_required()

gboolean logrotate_is_required ( LogRotateOptions logrotate_options,
const gsize  filesize 
)

◆ logrotate_options_defaults()

void logrotate_options_defaults ( LogRotateOptions logrotate_options)

◆ rotate_log_file()

gint rotate_log_file ( const gchar *  filename,
gsize  roation_suffix,
gsize  max_rotations 
)