Apache Log4cxx  Version 1.8.0
Loading...
Searching...
No Matches
asyncappender.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_ASYNC_APPENDER_H
19#define _LOG4CXX_ASYNC_APPENDER_H
20
24
25namespace LOG4CXX_NS
26{
28
90class LOG4CXX_EXPORT AsyncAppender :
91 public virtual spi::AppenderAttachable,
92#if LOG4CXX_ABI_VERSION <= 15
93 public virtual AppenderSkeleton
94#else
95 public AppenderSkeleton
96#endif
97{
98 protected:
99 struct AsyncAppenderPriv;
100
101 public:
108
109
113
117 virtual ~AsyncAppender();
118
125 void addAppender(const AppenderPtr newAppender) override;
126
130 void doAppend( LOG4CXX_APPEND_FORMAL_PARAMETERS ) override;
131
137 void append( LOG4CXX_APPEND_FORMAL_PARAMETERS ) override;
138
144 void close() override;
145
150 AppenderList getAllAppenders() const override;
151
158 AppenderPtr getAppender(const LogString& name) const override;
159
163 bool getLocationInfo() const;
169 bool isAttached(const AppenderPtr appender) const override;
170
173 bool requiresLayout() const override;
174
178 void removeAllAppenders() override;
179
184 void removeAppender(const AppenderPtr appender) override;
189 void removeAppender(const LogString& name) override;
190
195 bool replaceAppender(const AppenderPtr& oldAppender, const AppenderPtr& newAppender) LOG4CXX_16_VIRTUAL_SPECIFIER;
196
200 void replaceAppenders(const AppenderList& newList) LOG4CXX_16_VIRTUAL_SPECIFIER;
201
207 void setLocationInfo(bool flag);
208
214 void setBufferSize(int newSize);
215
220 int getBufferSize() const;
221
228 void setBlocking(bool newValue);
229
237 bool getBlocking() const;
238
239
250 void setOption(const LogString& option, const LogString& value) override;
251
252
253 private:
255 AsyncAppender& operator=(const AsyncAppender&);
256
257}; // class AsyncAppender
258LOG4CXX_PTR_DEF(AsyncAppender);
259} // namespace log4cxx
260
261#endif// _LOG4CXX_ASYNC_APPENDER_H
262
#define LOG4CXX_APPEND_FORMAL_PARAMETERS
Log in Appender specific way.
Definition appender.h:92
Implementation base class for all appenders.
Definition appenderskeleton.h:45
The AsyncAppender decouples logging event creation from output by processing log events asynchronousl...
Definition asyncappender.h:97
This Interface is for attaching Appenders to objects.
Definition appenderattachable.h:33
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition appender.h:32
LOG4CXX_LIST_DEF(AppenderList, AppenderPtr)
std::basic_string< logchar > LogString
Definition logstring.h:60
std::shared_ptr< Appender > AppenderPtr
Definition basicconfigurator.h:29
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:154
#define END_LOG4CXX_CAST_MAP()
Definition object.h:148
#define DECLARE_LOG4CXX_OBJECT(object)
Definition object.h:41
#define LOG4CXX_CAST_ENTRY_CHAIN(Interface)
Definition object.h:160
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:142
#define LOG4CXX_16_VIRTUAL_SPECIFIER
Definition socket.h:109