Fix build error with GCC6
[profile/ivi/log4cxx.git] / site / faq.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3
4
5
6
7
8
9
10
11
12
13 <!--
14
15  Licensed to the Apache Software Foundation (ASF) under one or more
16  contributor license agreements.  See the NOTICE file distributed with
17  this work for additional information regarding copyright ownership.
18  The ASF licenses this file to You under the Apache License, Version 2.0
19  (the "License"); you may not use this file except in compliance with
20  the License.  You may obtain a copy of the License at
21
22       http://www.apache.org/licenses/LICENSE-2.0
23
24  Unless required by applicable law or agreed to in writing, software
25  distributed under the License is distributed on an "AS IS" BASIS,
26  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27  See the License for the specific language governing permissions and
28  limitations under the License.
29
30 --><html xmlns="http://www.w3.org/1999/xhtml">
31   <head>
32     <title>log4cxx - Frequently Asked Technical Questions</title>
33     <style type="text/css" media="all">
34       @import url("./css/maven-base.css");
35       @import url("./css/maven-theme.css");
36       @import url("./css/site.css");
37     </style>
38     <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
39         <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
40       </head>
41   <body class="composite">
42     <div id="banner">
43                   <a href="http://logging.apache.org/" id="bannerLeft">
44     
45                                             <img src="images/ls-logo.jpg" alt="" />
46     
47             </a>
48                     <div class="clear">
49         <hr/>
50       </div>
51     </div>
52     <div id="breadcrumbs">
53           
54   
55
56   
57     
58   
59   
60     
61             <div class="xleft">
62         Last Published: 2008-03-31
63                           |   
64                 <a href="http://www.apache.org/" class="externalLink">Apache</a>
65                 &gt;
66       
67                 <a href="http://logging.apache.org/" class="externalLink">Logging Services</a>
68                 &gt;
69       
70           log4cxx
71                         </div>
72             <div class="xright">      
73   
74
75   
76     
77   
78   
79     
80   </div>
81       <div class="clear">
82         <hr/>
83       </div>
84     </div>
85     <div id="leftColumn">
86       <div id="navcolumn">
87            
88   
89
90   
91     
92   
93   
94     
95                    <h5>Get log4cxx</h5>
96             <ul>
97               
98     <li class="none">
99                     <a href="download.html">Download</a>
100           </li>
101               
102     <li class="none">
103                     <a href="changes-report.html">Changes</a>
104           </li>
105               
106     <li class="none">
107                     <a href="license.html">License</a>
108           </li>
109           </ul>
110               <h5>About log4cxx</h5>
111             <ul>
112               
113     <li class="none">
114                     <a href="index.html">What is log4cxx?</a>
115           </li>
116               
117     <li class="none">
118                     <a href="apidocs/index.html">API Documentation</a>
119           </li>
120               
121     <li class="none">
122               <strong>FAQ</strong>
123         </li>
124           </ul>
125               <h5>Community</h5>
126             <ul>
127               
128     <li class="none">
129                     <a href="mail-lists.html">Mailing Lists</a>
130           </li>
131               
132     <li class="none">
133                     <a href="issue-tracking.html">Issue Tracking</a>
134           </li>
135               
136     <li class="none">
137                     <a href="http://wiki.apache.org/logging-log4cxx" class="externalLink">Wiki</a>
138           </li>
139           </ul>
140               <h5>Development</h5>
141             <ul>
142               
143     <li class="none">
144                     <a href="source-repository.html">Repository</a>
145           </li>
146               
147           
148               
149       
150             
151       
152             
153       
154             
155       
156             
157       
158               
159         <li class="expanded">
160                     <a href="">Building</a>
161                   <ul>
162                   
163     <li class="none">
164                     <a href="building/autotools.html">autotools</a>
165           </li>
166                   
167     <li class="none">
168                     <a href="building/ant.html">Apache Ant</a>
169           </li>
170                   
171     <li class="none">
172                     <a href="building/maven.html">Apache Maven 2</a>
173           </li>
174                   
175     <li class="none">
176                     <a href="building/vstudio.html">Microsoft Visual Studio</a>
177           </li>
178                   
179     <li class="none">
180                     <a href="building/xcode.html">Apple Xcode</a>
181           </li>
182               </ul>
183         </li>
184           </ul>
185               <h5>Apache</h5>
186             <ul>
187               
188     <li class="none">
189                     <a href="http://www.apache.org" class="externalLink">Home</a>
190           </li>
191               
192     <li class="none">
193                     <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsorship</a>
194           </li>
195               
196     <li class="none">
197                     <a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a>
198           </li>
199               
200     <li class="none">
201                     <a href="http://www.apachecon.com" class="externalLink">Conferences</a>
202           </li>
203           </ul>
204                                            <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
205             <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
206           </a>
207                        
208   
209
210   
211     
212   
213   
214     
215         </div>
216     </div>
217     <div id="bodyColumn">
218       <div id="contentBox">
219         <div class="section"><h2><a name="top">Frequently Asked Technical Questions</a>
220 </h2>
221 <ol type="1"><li><a href="#custom_levels">How do I add a custom level to Apache log4cxx?</a>
222 </li>
223 <li><a href="#msvc_crash">My application on Windows crashes on shutdown?</a>
224 </li>
225 <li><a href="#unicode">Does Apache log4cxx support Unicode?</a>
226 </li>
227 </ol>
228 </div>
229 <dl><dt><a name="custom_levels">How do I add a custom level to Apache log4cxx?</a>
230 </dt>
231 <dd>
232       <p>This is a common topic for all the Apache logging frameworks and
233       typically motivated to try to categorize events by functionality or
234       audience.  An common request is to add an AUDIT level so that the
235       user can configure AUDIT level messages to go to a specific appender.
236       However, the logger name was designed explicitly to support
237       routing of messages by topic or audience.  The common
238       pattern of using classnames for logger names obscures the more
239       general capability of logger name to represent the topic or audience 
240       of the logging request.  The easiest approach to solve the underlying issue
241       is to use a logger names like "AUDIT.com.example.MyPackage.MyClass"
242       that allow all AUDIT messages to be routed to a particular appender.
243       If you attempted to use a level for that then you would lose
244       the ability to distinguish between different significances within
245       the audit messages.
246      </p><table border="0"><tr><td align="right"><a href="#top">[top]</a>
247 </td></tr></table><hr />
248 </dd>
249 <dt><a name="msvc_crash">My application on Windows crashes on shutdown?</a>
250 </dt>
251 <dd>
252       <p>Apache log4cxx API calls use C++ Standard Template Library string
253       parameters.  If the caller is using a different instance or type of the
254       C Runtime Library that log4cxx, then it is very likely that some memory
255       that was originally allocated by log4cxx would be freed by the caller.
256       If log4cxx and the caller are using different C RTL's, the program 
257       will likely crash at the point.  Use "Multithread DLL" with release
258       builds of log4cxx and "Multithread DLL Debug" with debug builds.
259      </p><table border="0"><tr><td align="right"><a href="#top">[top]</a>
260 </td></tr></table><hr />
261 </dd>
262 <dt><a name="unicode">Does Apache log4cxx support Unicode?</a>
263 </dt>
264 <dd>
265       <p>Yes.  Apache log4cxx exposes API methods in multiple string flavors
266       const char*, std::string, wchar_t*, std::wstring, CFStringRef et al.
267       const char* and std::string are interpreted according to the 
268       current locale settings.  Applications should call setlocale(LC_ALL, "")
269       on startup or the C RTL will assume US-ASCII.
270       Before being processed internally, all these are converted to the
271       LogString type which is one of several supported Unicode representations
272       selected by the --with-logchar option.  When using methods that take LogString arguments,
273       the LOG4CXX_STR() macro can be used to convert ASCII literals to 
274       the current LogString type.  FileAppenders support an encoding 
275       property which should be explicitly specified to "UTF-8" or "UTF-16"
276       for XML files.
277      </p><table border="0"><tr><td align="right"><a href="#top">[top]</a>
278 </td></tr></table></dd>
279 </dl>
280
281       </div>
282     </div>
283     <div class="clear">
284       <hr/>
285     </div>
286     <div id="footer">
287       <div class="xright">&#169;  
288           2008
289     
290           Apache Software Foundation
291           
292   
293
294   
295     
296   
297   
298     
299   </div>
300       <div class="clear">
301         <hr/>
302       </div>
303     </div>
304   </body>
305 </html>