Apache Log4cxx
Version 1.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
filewatchdog.h
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#ifndef _LOG4CXX_HELPERS_FILEWATCHDOG_H
19
#define _LOG4CXX_HELPERS_FILEWATCHDOG_H
20
21
#include <
log4cxx/logstring.h
>
22
#include <time.h>
23
#include <
log4cxx/helpers/pool.h
>
24
#include <
log4cxx/file.h
>
25
26
namespace
LOG4CXX_NS
27
{
28
namespace
helpers
29
{
30
35
class
LOG4CXX_EXPORT
FileWatchdog
36
{
37
public
:
38
virtual
~FileWatchdog
();
42
static
long
DEFAULT_DELAY
/*= 60000 ms*/
;
43
44
protected
:
45
FileWatchdog
(
const
File
& filename);
46
virtual
void
doOnChange
() = 0;
47
void
checkAndConfigure
();
48
const
File
&
file
();
49
50
public
:
54
void
setDelay
(
long
delay);
55
59
void
setFile
(
const
File
& filename);
60
64
void
start
();
65
69
void
stop
();
70
74
bool
is_active
();
75
79
static
void
stopAll
();
80
private
:
81
82
FileWatchdog
(
const
FileWatchdog
&);
83
FileWatchdog
& operator=(
const
FileWatchdog
&);
84
85
LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FileWatchdogPrivate, m_priv)
86
};
87
}
// namespace helpers
88
}
// namespace log4cxx
89
90
91
#endif
// _LOG4CXX_HELPERS_FILEWATCHDOG_H
log4cxx::File
An abstract representation of file and directory path names.
Definition
file.h:41
log4cxx::helpers::FileWatchdog::checkAndConfigure
void checkAndConfigure()
log4cxx::helpers::FileWatchdog::DEFAULT_DELAY
static long DEFAULT_DELAY
The default delay between every file modification check, set to 60 seconds.
Definition
filewatchdog.h:42
log4cxx::helpers::FileWatchdog::setDelay
void setDelay(long delay)
Use delay as the number of milliseconds to wait between each check for file changes.
log4cxx::helpers::FileWatchdog::file
const File & file()
log4cxx::helpers::FileWatchdog::is_active
bool is_active()
Is the task that periodically checks for a file change running?
log4cxx::helpers::FileWatchdog::start
void start()
Create an asynchronous task that periodically checks for a file change after first calling doOnChange...
log4cxx::helpers::FileWatchdog::stop
void stop()
Stop the task that periodically checks for a file change.
log4cxx::helpers::FileWatchdog::FileWatchdog
FileWatchdog(const File &filename)
log4cxx::helpers::FileWatchdog::stopAll
static void stopAll()
Stop all tasks that periodically check for a file change.
log4cxx::helpers::FileWatchdog::doOnChange
virtual void doOnChange()=0
log4cxx::helpers::FileWatchdog::setFile
void setFile(const File &filename)
Change the watched file to filename.
log4cxx::helpers::FileWatchdog::~FileWatchdog
virtual ~FileWatchdog()
file.h
logstring.h
pool.h
src
main
include
log4cxx
helpers
filewatchdog.h
Generated by
1.17.0 on
SITE_PUBLISHED_DATE
Copyright © 2017-2026
Apache Software Foundation
. Apache, Chainsaw, log4cxx, Log4j, Log4net, log4php and the Apache logo are
trademarks or registered trademarks
of The Apache Software Foundation.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Privacy Policy
.