2 * Copyright 2001-2005 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <log4cpp/Category.hh>
18 #include <log4cpp/RemoteSyslogAppender.hh>
19 #include <log4cpp/SyslogAppender.hh>
24 using namespace log4cpp;
28 Category& log = Category::getRoot();
31 string sysname = "sysname";
32 string relayer = "localhost";
33 RemoteSyslogAppender app(name, sysname, relayer, -1, -1);
36 log.error("Test Log Entry");
38 Category& syslog = Category::getInstance("test");
39 SyslogAppender sapp(name, sysname);
40 syslog.setAppender(sapp);
42 syslog.error("test Syslog entry");