Apache Log4cxx Version 1.1.0
Loading...
Searching...
No Matches
smtpappender.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_NET_SMTP_H
19#define _LOG4CXX_NET_SMTP_H
20
21
25
26namespace log4cxx
27{
28namespace net
29{
101class LOG4CXX_EXPORT SMTPAppender : public AppenderSkeleton
102{
103 private:
104 struct SMTPPriv;
106 SMTPAppender& operator=(const SMTPAppender&);
107 static bool asciiCheck(const LogString& value, const LogString& label);
108
114 bool checkEntryConditions();
115
116 public:
122
128 SMTPAppender(log4cxx::helpers::Pool& p);
129
134 SMTPAppender(spi::TriggeringEventEvaluatorPtr evaluator);
135
137
162 void setOption(const LogString& option, const LogString& value) override;
163
174 void activateOptions(helpers::Pool& p) override;
175
180 void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override;
181
182
183 void close() override;
184
188 LogString getTo() const;
189
193 LogString getCc() const;
194
198 LogString getBcc() const;
199
200
204 bool requiresLayout() const override;
205
209 void sendBuffer(log4cxx::helpers::Pool& p);
210
211
215 LogString getEvaluatorClass();
216
220 LogString getFrom() const;
221
225 LogString getSubject() const;
226
227
232 void setFrom(const LogString& from);
233
238 void setSubject(const LogString& subject);
239
247 void setBufferSize(int bufferSize);
248
253 void setSMTPHost(const LogString& smtpHost);
254
258 LogString getSMTPHost() const;
259
264 void setSMTPPort(int port);
265
269 int getSMTPPort() const;
270
275 void setTo(const LogString& to);
276
281 void setCc(const LogString& to);
282
287 void setBcc(const LogString& to);
288
289
294 void setSMTPUsername(const LogString& newVal);
295
299 LogString getSMTPUsername() const;
300
305 void setSMTPPassword(const LogString& newVal);
306
310 LogString getSMTPPassword() const;
311
315 int getBufferSize() const;
316
317
322 log4cxx::spi::TriggeringEventEvaluatorPtr getEvaluator() const;
323
328 void setEvaluator(log4cxx::spi::TriggeringEventEvaluatorPtr& trigger);
329
337 void setEvaluatorClass(const LogString& value);
338
343 void setLocationInfo(bool locationInfo);
344
348 bool getLocationInfo() const;
349}; // class SMTPAppender
350
351LOG4CXX_PTR_DEF(SMTPAppender);
352
353} // namespace net
354} // namespace log4cxx
355
356#endif // _LOG4CXX_NET_SMTP_H
Implementation base class for all appenders.
Definition: appenderskeleton.h:41
Send an e-mail when a specific logging event occurs, typically when an ERROR level logging event is s...
Definition: smtpappender.h:102
Definition: configuration.h:25
std::basic_string< logchar > LogString
Definition: logstring.h:60
#define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:157
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:151
#define DECLARE_LOG4CXX_OBJECT(object)
Definition: object.h:42
#define LOG4CXX_CAST_ENTRY_CHAIN(Interface)
Definition: object.h:163
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:145