objecthandler-cvs Mailing List for ObjectHandler (Page 22)
Brought to you by:
ericehlers,
nando
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(115) |
Jun
(109) |
Jul
(85) |
Aug
(49) |
Sep
(19) |
Oct
(105) |
Nov
(16) |
Dec
(43) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(63) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/msvc/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/msvc/tests Added Files: Makefile.am clean.bat runtests.bat shortsocketserver.dsp shortsocketserver.vcproj testsuite.dsp testsuite.vcproj Log Message: --- NEW FILE: runtests.bat --- @echo off if %1/==/ goto usage if not %1 == debug if not %1 == release if not %1 == unicode_d if not %1 == unicode_r goto usage cd ..\..\tests echo ********** Minimum ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite MinimumTestCase echo ********** Logger ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite LoggerTestCase echo ********** PatternLayout ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite PatternLayoutTest echo ********** HierarchyThreshold ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite HierarchyThresholdTestCase echo ********** CustomLogger ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite XLoggerTestCase echo ********** DefaultInit ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite TestCase1 copy input\xml\defaultInit.xml log4j.xml ..\msvc\bin\%1\testsuite TestCase2 del log4j.xml copy input\defaultInit3.properties log4j.properties ..\msvc\bin\%1\testsuite TestCase3 del log4j.properties copy input\defaultInit3.properties log4j.properties copy input\xml\defaultInit.xml log4j.xml ..\msvc\bin\%1\testsuite TestCase4 echo ********** AsyncAppender ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite AsyncAppenderTestCase echo ********** BoundedFIFO ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite BoundedFIFOTestCase echo ********** CyclicBuffer ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite CyclicBufferTestCase echo ********** DRFA ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite DRFATestCase echo ********** OptionConverter ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite OptionConverterTestCase echo ********** CustomLevel ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite CustomLevelTestCase echo ********** DOM ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite DOMTestCase echo ********** SocketServer ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite SocketServerTestCase echo ********** L7d ********** call ..\msvc\tests\clean.bat ..\msvc\bin\%1\testsuite L7dTestCase cd ..\msvc\tests goto done :usage echo Usage : runtests.bat TARGET echo where TARGET can be fixed to debug, release, unicode_d or unicode_r. :done --- NEW FILE: clean.bat --- if exist output rmdir /S /Q output mkdir output if exist log4j.xml del log4j.xml if exist log4j.properties del log4j.properties --- NEW FILE: testsuite.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="testsuite" ProjectGUID="{8A86EEE6-83B9-4407-9D5B-384273D9FDDD}" SccProjectName="" SccLocalPath=""> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="1" UseOfMFC="0" [...1171 lines suppressed...] RelativePath="..\..\tests\src\customlogger\xlogger.h"> </File> <File RelativePath="..\..\tests\src\util\xmllineattributefilter.h"> </File> <File RelativePath="..\..\tests\src\util\xmlthreadfilter.h"> </File> <File RelativePath="..\..\tests\src\util\xmltimestampfilter.h"> </File> </Filter> <Filter Name="Resource Files" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: shortsocketserver.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="shortsocketserver" ProjectGUID="{AD88BA19-4128-4130-B754-A1A1FAC68435}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Debug/shortsocketserver.exe" LinkIncremental="2" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/shortsocketserver.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="2" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Release/shortsocketserver.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Unicode Debug|Win32" OutputDirectory="Unicode_D" IntermediateDirectory="Unicode_D" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;UNICODE" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Unicode_R/shortsocketserver.exe" LinkIncremental="2" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/shortsocketserver.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Unicode Release|Win32" OutputDirectory="Unicode_R" IntermediateDirectory="Unicode_R" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;UNICODE" StringPooling="TRUE" RuntimeLibrary="2" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Unicode_R/shortsocketserver.exe" LinkIncremental="1" GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> <File RelativePath="..\..\tests\src\shortsocketserver.cpp"> </File> <File RelativePath="..\..\tests\src\xml\xlevel.cpp"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> <File RelativePath="..\..\tests\src\xml\xlevel.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: Makefile.am --- EXTRA_DIST = testsuite.dsp testsuite.vcproj clean.bat runtests.bat \ shortsocketserver.dsp shortsocketserver.vcproj --- NEW FILE: shortsocketserver.dsp --- # Microsoft Developer Studio Project File - Name="shortsocketserver" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=shortsocketserver - Win32 Unicode Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "shortsocketserver.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "shortsocketserver.mak" CFG="shortsocketserver - Win32 Unicode Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "shortsocketserver - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "shortsocketserver - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "shortsocketserver - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") !MESSAGE "shortsocketserver - Win32 Unicode Release" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "shortsocketserver - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "shortsocketserver___Win32_Release" # PROP BASE Intermediate_Dir "shortsocketserver___Win32_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Release/shortsocketserver.exe" !ELSEIF "$(CFG)" == "shortsocketserver - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "shortsocketserver___Win32_Debug" # PROP BASE Intermediate_Dir "shortsocketserver___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Debug/shortsocketserver.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "shortsocketserver - Win32 Unicode Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Unicode Debug" # PROP BASE Intermediate_Dir "Unicode Debug" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Unicode Debug" # PROP Intermediate_Dir "Unicode Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Debug/shortsocketserver.exe" /pdbtype:sept # ADD LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Unicode_D/shortsocketserver.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "shortsocketserver - Win32 Unicode Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Unicode Release" # PROP BASE Intermediate_Dir "Unicode Release" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Unicode Release" # PROP Intermediate_Dir "Unicode Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Release/shortsocketserver.exe" # ADD LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Unicode_R/shortsocketserver.exe" !ENDIF # Begin Target # Name "shortsocketserver - Win32 Release" # Name "shortsocketserver - Win32 Debug" # Name "shortsocketserver - Win32 Unicode Debug" # Name "shortsocketserver - Win32 Unicode Release" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\tests\src\shortsocketserver.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\xml\xlevel.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\tests\src\xml\xlevel.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: testsuite.dsp --- # Microsoft Developer Studio Project File - Name="testsuite" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=testsuite - Win32 Unicode Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "testsuite.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "testsuite.mak" CFG="testsuite - Win32 Unicode Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "testsuite - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "testsuite - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "testsuite - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") !MESSAGE "testsuite - Win32 Unicode Release" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "testsuite - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 log4cxx.lib boost_regex_vc6_mdi.lib cppunit.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Release/testsuite.exe" !ELSEIF "$(CFG)" == "testsuite - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 log4cxx.lib boost_regex_vc6_mdid.lib cppunitd.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Debug/testsuite.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "testsuite - Win32 Unicode Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "testsuite___Win32_Unicode_Debug" # PROP BASE Intermediate_Dir "testsuite___Win32_Unicode_Debug" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Unicode_D" # PROP Intermediate_Dir "Unicode_D" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 log4cxx.lib boost_regex_vc6_mdid.lib cppunitd.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Debug/testsuite.exe" /pdbtype:sept # ADD LINK32 log4cxx.lib boost_regex_vc6_mdid.lib cppunitd.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Unicode_D/testsuite.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "testsuite - Win32 Unicode Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "testsuite___Win32_Unicode_Release" # PROP BASE Intermediate_Dir "testsuite___Win32_Unicode_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Unicode_R" # PROP Intermediate_Dir "Unicode_R" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 log4cxx.lib boost_regex_vc6_mdi.lib cppunit.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Unicode_R/testsuite.exe" !ENDIF # Begin Target # Name "testsuite - Win32 Release" # Name "testsuite - Win32 Debug" # Name "testsuite - Win32 Unicode Debug" # Name "testsuite - Win32 Unicode Release" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\tests\src\util\absolutedateandtimefilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\absolutetimefilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\asyncappendertestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\helpers\boundedfifotestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\compare.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\controlfilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\xml\customleveltestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\helpers\cyclicbuffertestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\xml\domtestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\drfatestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\filter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\hierarchythresholdtestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\iso8601filter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\l7dtestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\linenumberfilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\loggertestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\main.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\minimumtestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\helpers\optionconvertertestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\patternlayouttest.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\relativetimefilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\net\socketservertestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\defaultinit\testcase1.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\defaultinit\testcase2.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\defaultinit\testcase3.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\defaultinit\testcase4.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\threadfilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\transformer.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\vectorappender.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\xml\xlevel.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\customlogger\xlogger.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\customlogger\xloggertestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\xml\xmllayouttestcase.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\xmllineattributefilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\xmlthreadfilter.cpp # End Source File # Begin Source File SOURCE=..\..\tests\src\util\xmltimestampfilter.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\tests\src\util\absolutedateandtimefilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\absolutetimefilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\compare.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\controlfilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\filter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\iso8601filter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\linenumberfilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\relativetimefilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\net\socketservertestcase.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\threadfilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\transformer.h # End Source File # Begin Source File SOURCE=..\..\tests\src\vectorappender.h # End Source File # Begin Source File SOURCE=..\..\tests\src\xml\xlevel.h # End Source File # Begin Source File SOURCE=..\..\tests\src\customlogger\xlogger.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\xmllineattributefilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\xmlthreadfilter.h # End Source File # Begin Source File SOURCE=..\..\tests\src\util\xmltimestampfilter.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:53
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/tests/src/xml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/tests/src/xml Added Files: Makefile.am customleveltestcase.cpp domtestcase.cpp xlevel.cpp xlevel.h xmllayouttestcase.cpp Log Message: --- NEW FILE: xlevel.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "xlevel.h" #include <log4cxx/helpers/stringhelper.h> using namespace log4cxx; using namespace log4cxx::helpers; IMPLEMENT_LOG4CXX_LEVEL(XLevel) #define TRACE_STR _T("TRACE") #define LETHAL_STR _T("LETHAL") const LevelPtr XLevel::TRACE = new XLevel(XLevel::TRACE_INT, TRACE_STR, 7); const LevelPtr XLevel::LETHAL = new XLevel(XLevel::LETHAL_INT, LETHAL_STR, 0); XLevel::XLevel(int level, const String& levelStr, int syslogEquivalent) : Level(level, levelStr, syslogEquivalent) { } const LevelPtr& XLevel::toLevel(const String& sArg) { return toLevel(sArg, TRACE); } const LevelPtr& XLevel::toLevel(int val) { return toLevel(val, TRACE); } const LevelPtr& XLevel::toLevel(int val, const LevelPtr& defaultLevel) { switch(val) { case TRACE_INT: return TRACE; case LETHAL_INT: return LETHAL; default: return defaultLevel; } } const LevelPtr& XLevel::toLevel(const String& sArg, const LevelPtr& defaultLevel) { if (sArg.empty()) { return defaultLevel; } String s = StringHelper::toUpperCase(sArg); if(s == (TRACE_STR)) return TRACE; if(s == (LETHAL_STR)) return LETHAL; return defaultLevel; } --- NEW FILE: customleveltestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/config.h> #ifdef HAVE_XML #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/xml/domconfigurator.h> #include <log4cxx/consoleappender.h> #include <log4cxx/patternlayout.h> #include "../util/compare.h" #include "xlevel.h" using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::xml; #define TEMP _T("output/temp") class CustomLevelTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(CustomLevelTestCase); CPPUNIT_TEST(test1); CPPUNIT_TEST(test2); CPPUNIT_TEST(test3); CPPUNIT_TEST(test4); CPPUNIT_TEST_SUITE_END(); LoggerPtr root; LoggerPtr logger; public: void setUp() { root = Logger::getRootLogger(); logger = Logger::getLogger(_T("xml.CustomLevelTestCase")); } void tearDown() { root->getLoggerRepository()->resetConfiguration(); LoggerPtr logger = Logger::getLogger(_T("LOG4J")); logger->setAdditivity(false); logger->addAppender( new ConsoleAppender(new PatternLayout(_T("log4j: %-22c{2} - %m%n")))); } void test1() { DOMConfigurator::configure(_T("input/xml/customLevel1.xml")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/customLevel.1"))); } void test2() { DOMConfigurator::configure(_T("input/xml/customLevel2.xml")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/customLevel.2"))); } void test3() { DOMConfigurator::configure(_T("input/xml/customLevel3.xml")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/customLevel.3"))); } void test4() { DOMConfigurator::configure(_T("input/xml/customLevel4.xml")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/customLevel.4"))); } void common() { int i = 0; LOG4CXX_DEBUG(logger, _T("Message ") << ++i); LOG4CXX_INFO(logger, _T("Message ") << ++i); LOG4CXX_WARN(logger, _T("Message ") << ++i); LOG4CXX_ERROR(logger, _T("Message ") << ++i); LOG4CXX_LOG(logger, XLevel::TRACE, _T("Message ") << ++i); } }; CPPUNIT_TEST_SUITE_REGISTRATION(CustomLevelTestCase); #endif //HAVE_XML --- NEW FILE: xmllayouttestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/xml/xmllayout.h> #include <log4cxx/fileappender.h> #include <log4cxx/mdc.h> #include "../util/transformer.h" #include "../util/compare.h" #include "../util/xmltimestampfilter.h" #include "../util/xmllineattributefilter.h" #include "../util/xmlthreadfilter.h" using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::xml; #define FILTERED _T("output/filtered") #define TEMP _T("output/temp") class X { public: X() { LoggerPtr logger = Logger::getLogger(_T("org.apache.log4j.xml.XMLLayoutTestCase$X")); LOG4CXX_INFO(logger, _T("in X() constructor")); } }; class XMLLayoutTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(XMLLayoutTestCase); CPPUNIT_TEST(basic); CPPUNIT_TEST(locationInfo); CPPUNIT_TEST(testCDATA); CPPUNIT_TEST(testNULL); CPPUNIT_TEST(testMDC); CPPUNIT_TEST_SUITE_END(); LoggerPtr root; LoggerPtr logger; public: void setUp() { root = Logger::getRootLogger(); logger = Logger::getLogger(_T("org.apache.log4j.xml.XMLLayoutTestCase")); } void tearDown() { logger->getLoggerRepository()->resetConfiguration(); } void basic() { XMLLayoutPtr xmlLayout = new XMLLayout(); root->addAppender(new FileAppender(xmlLayout, TEMP, false)); common(); XMLTimestampFilter xmlTimestampFilter; XMLThreadFilter xmlThreadFilter; std::vector<Filter *> filters; filters.push_back(&xmlTimestampFilter); filters.push_back(&xmlThreadFilter); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/xmlLayout.1"))); } void locationInfo() { XMLLayoutPtr xmlLayout = new XMLLayout(); xmlLayout->setLocationInfo(true); root->addAppender(new FileAppender(xmlLayout, TEMP, false)); common(); XMLTimestampFilter xmlTimestampFilter; XMLLineAttributeFilter xmlLineAttributeFilter; XMLThreadFilter xmlThreadFilter; std::vector<Filter *> filters; filters.push_back(&xmlTimestampFilter); filters.push_back(&xmlLineAttributeFilter); filters.push_back(&xmlThreadFilter); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/xmlLayout.2"))); } void testCDATA() { XMLLayoutPtr xmlLayout = new XMLLayout(); xmlLayout->setLocationInfo(true); root->addAppender(new FileAppender(xmlLayout, TEMP, false)); LOG4CXX_DEBUG(logger, _T("Message with embedded <![CDATA[<hello>hi</hello>]]>.")); XMLTimestampFilter xmlTimestampFilter; XMLLineAttributeFilter xmlLineAttributeFilter; XMLThreadFilter xmlThreadFilter; std::vector<Filter *> filters; filters.push_back(&xmlTimestampFilter); filters.push_back(&xmlLineAttributeFilter); filters.push_back(&xmlThreadFilter); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/xmlLayout.3"))); } void testNULL() { XMLLayoutPtr xmlLayout = new XMLLayout(); root->addAppender(new FileAppender(xmlLayout, TEMP, false)); LOG4CXX_DEBUG(logger, _T("hi")); LOG4CXX_DEBUG(logger, _T("")); XMLTimestampFilter xmlTimestampFilter; XMLThreadFilter xmlThreadFilter; std::vector<Filter *> filters; filters.push_back(&xmlTimestampFilter); filters.push_back(&xmlThreadFilter); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/xmlLayout.null"))); } void testMDC() { XMLLayoutPtr xmlLayout = new XMLLayout(); root->addAppender(new FileAppender(xmlLayout, TEMP, false)); MDC::clear(); MDC::put(_T("key1"), _T("val1")); MDC::put(_T("key2"), _T("val2")); LOG4CXX_DEBUG(logger, _T("Hello")); MDC::clear(); XMLTimestampFilter xmlTimestampFilter; XMLThreadFilter xmlThreadFilter; std::vector<Filter *> filters; filters.push_back(&xmlTimestampFilter); filters.push_back(&xmlThreadFilter); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/xmlLayout.mdc.1"))); } // not incuded in the tests for the moment ! void holdTestMDCEscaped() { XMLLayoutPtr xmlLayout = new XMLLayout(); root->addAppender(new FileAppender(xmlLayout, TEMP, false)); MDC::clear(); MDC::put(_T("blahAttribute"), _T("<blah value=\"blah\">")); MDC::put(_T("<blahKey value=\"blah\"/>"), _T("blahValue")); LOG4CXX_DEBUG(logger, _T("Hello")); MDC::clear(); XMLTimestampFilter xmlTimestampFilter; XMLThreadFilter xmlThreadFilter; std::vector<Filter *> filters; filters.push_back(&xmlTimestampFilter); filters.push_back(&xmlThreadFilter); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/xmlLayout.mdc.2"))); } void common() { int i = -1; X x; LOG4CXX_DEBUG(logger, _T("Message ") << ++i); LOG4CXX_DEBUG(root, _T("Message ") << i); LOG4CXX_INFO(logger, _T("Message ") << ++i); LOG4CXX_INFO(root, _T("Message ") << i); LOG4CXX_WARN(logger, _T("Message ") << ++i); LOG4CXX_WARN(root, _T("Message ") << i); LOG4CXX_ERROR(logger, _T("Message ") << ++i); LOG4CXX_ERROR(root, _T("Message ") << i); LOG4CXX_FATAL(logger, _T("Message ") << ++i); LOG4CXX_FATAL(root, _T("Message ") << i); } }; CPPUNIT_TEST_SUITE_REGISTRATION(XMLLayoutTestCase); --- NEW FILE: domtestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/config.h> #ifdef HAVE_XML #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/xml/domconfigurator.h> #include "../util/compare.h" #include "xlevel.h" #include "../util/controlfilter.h" #include "../util/iso8601filter.h" #include "../util/threadfilter.h" #include "../util/transformer.h" using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::xml; #define TEMP_A1 _T("output/temp.A1") #define TEMP_A2 _T("output/temp.A2") #define FILTERED_A1 _T("output/filtered.A1") #define FILTERED_A2 _T("output/filtered.A2") #define TEST1_1A_PAT \ _T("(DEBUG|INFO |WARN |ERROR|FATAL) \\w*\\.\\w* - Message \\d") #define TEST1_1B_PAT _T("(DEBUG|INFO |WARN |ERROR|FATAL) root - Message \\d") #define TEST1_2_PAT _T("^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3} ") \ _T("\\[\\d*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message \\d") class DOMTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(DOMTestCase); CPPUNIT_TEST(test1); CPPUNIT_TEST_SUITE_END(); LoggerPtr root; LoggerPtr logger; public: void setUp() { root = Logger::getRootLogger(); logger = Logger::getLogger(_T("org.apache.log4j.xml.DOMTestCase")); } void tearDown() { root->getLoggerRepository()->resetConfiguration(); } void test1() { DOMConfigurator::configure(_T("input/xml/DOMTestCase1.xml")); common(); ControlFilter cf1; cf1 << TEST1_1A_PAT << TEST1_1B_PAT; ControlFilter cf2; cf2 << TEST1_2_PAT; ThreadFilter threadFilter; ISO8601Filter iso8601Filter; std::vector<Filter *> filters1; filters1.push_back(&cf1); std::vector<Filter *> filters2; filters2.push_back(&cf2); filters2.push_back(&threadFilter); filters2.push_back(&iso8601Filter); try { Transformer::transform(TEMP_A1, FILTERED_A1, filters1); Transformer::transform(TEMP_A2, FILTERED_A2, filters2); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED_A1, _T("witness/dom.A1.1"))); CPPUNIT_ASSERT(Compare::compare(FILTERED_A2, _T("witness/dom.A2.1"))); } void common() { int i = -1; LOG4CXX_DEBUG(logger, _T("Message ") << ++i); LOG4CXX_DEBUG(root, _T("Message ") << i); LOG4CXX_INFO(logger, _T("Message ") << ++i); LOG4CXX_INFO(root, _T("Message ") << i); LOG4CXX_WARN(logger, _T("Message ") << ++i); LOG4CXX_WARN(root, _T("Message ") << i); LOG4CXX_ERROR(logger, _T("Message ") << ++i); LOG4CXX_ERROR(root, _T("Message ") << i); LOG4CXX_FATAL(logger, _T("Message ") << ++i); LOG4CXX_FATAL(root, _T("Message ") << i); } }; CPPUNIT_TEST_SUITE_REGISTRATION(DOMTestCase); #endif //HAVE_XML --- NEW FILE: xlevel.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/level.h> namespace log4cxx { class XLevel : public Level { DECLARE_LOG4CXX_LEVEL(XLevel) public: enum { TRACE_INT = Level::DEBUG_INT - 1, LETHAL_INT = Level::FATAL_INT + 1 }; static const LevelPtr TRACE; static const LevelPtr LETHAL; XLevel(int level, const String& levelStr, int syslogEquivalent); /** Convert the string passed as argument to a level. If the conversion fails, then this method returns #DEBUG. */ static const LevelPtr& toLevel(const String& sArg); /** Convert an integer passed as argument to a level. If the conversion fails, then this method returns #DEBUG. */ static const LevelPtr& toLevel(int val); /** Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default. */ static const LevelPtr& toLevel(int val, const LevelPtr& defaultLevel); /** Convert the string passed as argument to a level. If the conversion fails, then this method returns the value of <code>defaultLevel</code>. */ static const LevelPtr& toLevel(const String& sArg, const LevelPtr& defaultLevel); }; } --- NEW FILE: Makefile.am --- EXTRA_DIST = $(top_srcdir)/tests/src/xml/*.cpp noinst_HEADERS= $(top_srcdir)/tests/src/xml/*.h if TESTS noinst_LIBRARIES = libxml.a INCLUDES = -I$(top_srcdir)/include libxml_a_SOURCES = \ customleveltestcase.cpp \ domtestcase.cpp \ xlevel.cpp \ xmllayouttestcase.cpp check: libxml.a endif |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:53
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx/config Added Files: Makefile.am propertysetter.h Log Message: --- NEW FILE: Makefile.am --- configincdir = $(includedir)/log4cxx/config configinc_HEADERS= $(top_srcdir)/include/log4cxx/config/*.h --- NEW FILE: propertysetter.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_CONFIG_PROPERTYSETTER_H #define _LOG4CXX_CONFIG_PROPERTYSETTER_H #include <log4cxx/helpers/tchar.h> #include <log4cxx/helpers/objectptr.h> namespace log4cxx { namespace helpers { class Object; typedef ObjectPtrT<Object> ObjectPtr; class Properties; } namespace config { /** General purpose Object property setter. Clients repeatedly invokes {@link #setProperty setProperty(name,value)} in order to invoke setters on the Object specified in the constructor. <p>Usage: <pre> PropertySetter ps(anObject); ps.set("name", "Joe"); ps.set("age", "32"); ps.set("isMale", "true"); </pre> will cause the invocations anObject->setOption("name", "Joe"), anObject->setOption("age", "32") and anObject->setOption("isMale", "true") if the spi::OptionHandler interface is supported by anObject. */ class LOG4CXX_EXPORT PropertySetter { protected: helpers::ObjectPtr obj; public: /** Create a new PropertySetter for the specified Object. This is done in prepartion for invoking #setProperty one or more times. @param obj the object for which to set properties */ PropertySetter(helpers::ObjectPtr obj); /** Set the properties of an object passed as a parameter in one go. The <code>properties</code> are parsed relative to a <code>prefix</code>. @param obj The object to configure. @param properties A java.util.Properties containing keys and values. @param prefix Only keys having the specified prefix will be set. */ static void setProperties(helpers::ObjectPtr obj, helpers::Properties& properties, const String& prefix); /** Set the properites for the object that match the <code>prefix</code> passed as parameter. */ void setProperties(helpers::Properties& properties, const String& prefix); /** Set a property on this PropertySetter's Object. If the underlying Object supports the spi::OptionHandler interface, the {@link spi::OptionHandler#setOption setOption} method is called. @param name name of the property @param value String value of the property */ void setProperty(const String& name, const String& value); void activate(); }; // class PropertySetter } // namespace config; }; // namespace log4cxx #endif //_LOG4CXX_CONFIG_PROPERTYSETTER_H |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:53
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/tests Added Files: L7D_en_US.properties L7D_fr.properties L7D_fr_CH.properties Makefile.am log4j.dtd Log Message: --- NEW FILE: L7D_en_US.properties --- test=This is the English, US test. hello_world=Hello world. msg1=This is test number {0} with string argument {1}. --- NEW FILE: L7D_fr_CH.properties --- test=Ceci est le test en francais pour la p'tite Suisse. hello world=Salut le monde. --- NEW FILE: Makefile.am --- SUBDIRS = input src witness EXTRA_DIST = log4j.dtd L7D_en_US.properties L7D_fr_CH.properties L7D_fr.properties if TESTS prepare: @if test ! -d "output"; then \ mkdir output; \ fi; @rm -rf log4j.xml @rm -rf log4j.properties build: check-recursive prepare cleanOutputDir: @rm -f output/* check: regression longUnit regression: Minimum Logger DOM CustomLevel \ CustomLogger PatternLayout \ HierarchyThreshold DefaultInit SocketServer \ XMLLayout AsyncAppender ErrorHandler \ OptionConverter BoundedFIFO \ CyclicBuffer DRFA LevelMatchFilter \ LevelRangeFilter PatternParser L7d longUnit: Minimum: build cleanOutputDir src/testsuite MinimumTestCase Logger: build cleanOutputDir src/testsuite LoggerTestCase PatternLayout: build cleanOutputDir src/testsuite PatternLayoutTest HierarchyThreshold: build cleanOutputDir src/testsuite HierarchyThresholdTestCase DOM: build cleanOutputDir src/testsuite DOMTestCase CustomLevel: build cleanOutputDir src/testsuite CustomLevelTestCase CustomLogger: build cleanOutputDir src/testsuite XLoggerTestCase DefaultInit: build cleanOutputDir src/testsuite TestCase1 @cp input/xml/defaultInit.xml log4j.xml src/testsuite TestCase2 @rm -f log4j.xml @cp input/defaultInit3.properties log4j.properties src/testsuite TestCase3 @rm -f log4j.properties @cp input/defaultInit3.properties log4j.properties @cp input/xml/defaultInit.xml log4j.xml src/testsuite TestCase4 @rm -f log4j.xml @rm -f log4j.properties SocketServer: build cleanOutputDir src/testsuite SocketServerTestCase XMLLayout: build cleanOutputDir src/testsuite XMLLayoutTestCase AsyncAppender: build cleanOutputDir src/testsuite AsyncAppenderTestCase LevelMatchFilter: build cleanOutputDir src/testsuite LevelMatchFilterTestCase LevelRangeFilter: build cleanOutputDir src/testsuite LevelRangeFilterTestCase ErrorHandler: build cleanOutputDir src/testsuite ErrorHandlerTestCase OptionConverter: build cleanOutputDir src/testsuite OptionConverterTestCase BoundedFIFO: build cleanOutputDir src/testsuite BoundedFIFOTestCase CyclicBuffer: build cleanOutputDir src/testsuite CyclicBufferTestCase DRFA: build cleanOutputDir src/testsuite DRFATestCase PatternParser: build cleanOutputDir L7d: build cleanOutputDir src/testsuite L7dTestCase endif --- NEW FILE: L7D_fr.properties --- test=Ceci est le test en francais pour la France. hello_world=Bonjour la France. msg1=Ceci est le test numero {0} contenant l'argument {1}. --- NEW FILE: log4j.dtd --- <?xml version="1.0" encoding="UTF-8" ?> <!-- Authors: Chris Taylor, Ceki Gulcu. --> <!-- Version: 1.2 --> <!-- A configuration element consists of optional renderer elements,appender elements, categories and an optional root element. --> <!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?, categoryFactory?)> <!-- The "threshold" attribute takes a level value such that all --> <!-- logging statements with a level equal or below this value are --> <!-- disabled. --> <!-- Setting the "debug" enable the printing of internal log4j logging --> <!-- statements. --> <!-- By default, debug attribute is "null", meaning that we not do touch --> <!-- internal log4j logging settings. The "null" value for the threshold --> <!-- attribute can be misleading. The threshold field of a repository --> <!-- cannot be set to null. The "null" value for the threshold attribute --> <!-- simply means don't touch the threshold field, the threshold field --> <!-- keeps its old value. --> <!ATTLIST log4j:configuration xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" threshold (all|debug|info|warn|error|fatal|off|null) "null" debug (true|false|null) "null" > <!-- renderer elements allow the user to customize the conversion of --> <!-- message objects to String. --> <!ELEMENT renderer EMPTY> <!ATTLIST renderer renderedClass CDATA #REQUIRED renderingClass CDATA #REQUIRED > <!-- Appenders must have a name and a class. --> <!-- Appenders may contain an error handler, a layout, optional parameters --> <!-- and filters. They may also reference (or include) other appenders. --> <!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)> <!ATTLIST appender name ID #REQUIRED class CDATA #REQUIRED > <!ELEMENT layout (param*)> <!ATTLIST layout class CDATA #REQUIRED > <!ELEMENT filter (param*)> <!ATTLIST filter class CDATA #REQUIRED > <!-- ErrorHandlers can be of any class. They can admit any number of --> <!-- parameters. --> <!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)> <!ATTLIST errorHandler class CDATA #REQUIRED > <!ELEMENT root-ref EMPTY> <!ELEMENT logger-ref EMPTY> <!ATTLIST logger-ref ref IDREF #REQUIRED > <!ELEMENT param EMPTY> <!ATTLIST param name CDATA #REQUIRED value CDATA #REQUIRED > <!-- The priority class is org.apache.log4j.Level by default --> <!ELEMENT priority (param*)> <!ATTLIST priority class CDATA #IMPLIED value CDATA #REQUIRED > <!-- The level class is org.apache.log4j.Level by default --> <!ELEMENT level (param*)> <!ATTLIST level class CDATA #IMPLIED value CDATA #REQUIRED > <!-- If no level element is specified, then the configurator MUST not --> <!-- touch the level of the named category. --> <!ELEMENT category (param*,(priority|level)?,appender-ref*)> <!ATTLIST category class CDATA #IMPLIED name CDATA #REQUIRED additivity (true|false) "true" > <!-- If no level element is specified, then the configurator MUST not --> <!-- touch the level of the named logger. --> <!ELEMENT logger (level?,appender-ref*)> <!ATTLIST logger name ID #REQUIRED additivity (true|false) "true" > <!ELEMENT categoryFactory (param*)> <!ATTLIST categoryFactory class CDATA #REQUIRED> <!ELEMENT appender-ref EMPTY> <!ATTLIST appender-ref ref IDREF #REQUIRED > <!-- If no priority element is specified, then the configurator MUST not --> <!-- touch the priority of root. --> <!-- The root category always exists and cannot be subclassed. --> <!ELEMENT root (param*, (priority|level)?, appender-ref*)> <!-- ==================================================================== --> <!-- A logging event --> <!-- ==================================================================== --> <!ELEMENT log4j:eventSet (log4j:event*)> <!ATTLIST log4j:eventSet xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" version (1.1|1.2) "1.2" includesLocationInfo (true|false) "true" > <!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, log4j:locationInfo?) > <!-- The timestamp format is application dependent. --> <!ATTLIST log4j:event logger CDATA #REQUIRED level CDATA #REQUIRED thread CDATA #REQUIRED timestamp CDATA #REQUIRED > <!ELEMENT log4j:message (#PCDATA)> <!ELEMENT log4j:NDC (#PCDATA)> <!ELEMENT log4j:throwable (#PCDATA)> <!ELEMENT log4j:locationInfo EMPTY> <!ATTLIST log4j:locationInfo class CDATA #REQUIRED method CDATA #REQUIRED file CDATA #REQUIRED line CDATA #REQUIRED > |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:52
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/tests/src/customlogger In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/tests/src/customlogger Added Files: Makefile.am xlogger.cpp xlogger.h xloggertestcase.cpp Log Message: --- NEW FILE: Makefile.am --- EXTRA_DIST = $(top_srcdir)/tests/src/customlogger/*.cpp noinst_HEADERS= $(top_srcdir)/tests/src/customlogger/*.h if TESTS noinst_LIBRARIES = libcustomlogger.a INCLUDES = -I$(top_srcdir)/include libcustomlogger_a_SOURCES = \ xlogger.cpp\ xloggertestcase.cpp check: libcustomlogger.a endif --- NEW FILE: xlogger.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "xlogger.h" #include <log4cxx/level.h> #include <log4cxx/logmanager.h> using namespace log4cxx; IMPLEMENT_LOG4CXX_OBJECT(XLogger) IMPLEMENT_LOG4CXX_OBJECT(XFactory) String XLogger::FQCN = XLogger::getStaticClass().getName() + _T("."); XFactoryPtr XLogger::factory = new XFactory(); void XLogger::debug(const String& message, const char* file, int line) { if (repository->isDisabled(Level::DEBUG_INT)) { return; } if (XLevel::LETHAL->isGreaterOrEqual(this->getEffectiveLevel())) { forcedLog(FQCN, Level::DEBUG, message + _T(" ") + suffix, file,line); } } void XLogger::lethal(const String& message, const char* file, int line) { if (repository->isDisabled(XLevel::LETHAL_INT)) { return; } if (XLevel::LETHAL->isGreaterOrEqual(this->getEffectiveLevel())) { forcedLog(FQCN, XLevel::LETHAL, message, file,line); } } void XLogger::lethal(const String& message) { if (repository->isDisabled(XLevel::LETHAL_INT)) { return; } if (XLevel::LETHAL->isGreaterOrEqual(this->getEffectiveLevel())) { forcedLog(FQCN, XLevel::LETHAL, message); } } LoggerPtr XLogger::getLogger(const String& name) { return LogManager::getLogger(name, factory); } LoggerPtr XLogger::getLogger(const helpers::Class& clazz) { return XLogger::getLogger(clazz.getName()); } void XLogger::trace(const String& message, const char* file, int line) { if (repository->isDisabled(XLevel::TRACE_INT)) { return; } if (XLevel::TRACE->isGreaterOrEqual(this->getEffectiveLevel())) { forcedLog(FQCN, XLevel::TRACE, message, file, line); } } void XLogger::trace(const String& message) { if (repository->isDisabled(XLevel::TRACE_INT)) { return; } if (XLevel::TRACE->isGreaterOrEqual(this->getEffectiveLevel())) { forcedLog(FQCN, XLevel::TRACE, message); } } XFactory::XFactory() { } LoggerPtr XFactory::makeNewLoggerInstance(const String& name) { return new XLogger(name); } --- NEW FILE: xloggertestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/config.h> #ifdef HAVE_XML #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include "xlogger.h" #include <log4cxx/xml/domconfigurator.h> #include "../util/transformer.h" #include "../util/compare.h" using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::xml; /** Tests handling of custom loggers. */ class XLoggerTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(XLoggerTestCase); CPPUNIT_TEST(test1); CPPUNIT_TEST(test2); CPPUNIT_TEST_SUITE_END(); XLoggerPtr logger; public: void setUp() { logger = (XLoggerPtr) XLogger::getLogger( _T("org.apache.log4j.customLogger.XLoggerTestCase")); } void tearDown() { logger->getLoggerRepository()->resetConfiguration(); } void test1() { common(_T("1")); } void test2() { common(_T("2")); } void common(const String& number) { DOMConfigurator::configure(_T("input/xml/customLogger") +number+_T(".xml")); int i = -1; LOG4CXX_TRACE(logger, _T("Message ") << ++i); LOG4CXX_DEBUG(logger, _T("Message ") << ++i); LOG4CXX_WARN(logger, _T("Message ") << ++i); LOG4CXX_ERROR(logger, _T("Message ") << ++i); LOG4CXX_FATAL(logger, _T("Message ") << ++i); LOG4CXX_DEBUG(logger, _T("Message ") << ++i); CPPUNIT_ASSERT(Compare::compare(_T("output/temp"), _T("witness/customLogger.")+number)); } }; CPPUNIT_TEST_SUITE_REGISTRATION(XLoggerTestCase); #endif //HAVE_XML --- NEW FILE: xlogger.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/logger.h> #include "../xml/xlevel.h" namespace log4cxx { // Any sub-class of Logger must also have its own implementation of // CategoryFactory. class XFactory : public virtual spi::LoggerFactory, public virtual helpers::ObjectImpl { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(XFactory) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(XFactory) LOG4CXX_CAST_ENTRY(spi::LoggerFactory) END_LOG4CXX_CAST_MAP() XFactory(); virtual LoggerPtr makeNewLoggerInstance(const String& name); }; typedef helpers::ObjectPtrT<XFactory> XFactoryPtr; /** A simple example showing Logger sub-classing. It shows the minimum steps necessary to implement one's {@link LoggerFactory}. Note that sub-classes follow the hierarchy even if its loggers belong to different classes. */ class XLogger : public Logger { // It's usually a good idea to add a dot suffix to the fully // qualified class name. This makes caller localization to work // properly even from classes that have almost the same fully // qualified class name as XLogger, such as XLogegoryTest. static String FQCN; // It's enough to instantiate a factory once and for all. static XFactoryPtr factory; String suffix; public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(XLogger) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(XLogger) LOG4CXX_CAST_ENTRY_CHAIN(Logger) END_LOG4CXX_CAST_MAP() /** Just calls the parent constuctor. */ XLogger(const String& name) : Logger(name) {} /** Nothing to activate. */ void activateOptions() {} /** Overrides the standard debug method by appending the value of suffix variable to each message. */ void debug(const String& message, const char* file=0, int line=-1); /** We introduce a new printing method in order to support {@link XLevel#LETHAL}. */ void lethal(const String& message, const char* file=0, int line=-1); /** We introduce a new printing method in order to support {@link XLevel#LETHAL}. */ void lethal(const String& message); static LoggerPtr getLogger(const String& name); static LoggerPtr getLogger(const helpers::Class& clazz); String getSuffix() const { return suffix; } void setSuffix(const String& suffix) { this->suffix = suffix; } /** We introduce a new printing method that takes the TRACE level. */ void trace(const String& message, const char* file=0, int line=-1); /** We introduce a new printing method that takes the TRACE level. */ void trace(const String& message); }; typedef helpers::ObjectPtrT<XLogger> XLoggerPtr; } #define LOG4CXX_TRACE(logger, message) { \ if (logger->isEnabledFor(log4cxx::XLevel::TRACE)) {\ StringBuffer oss; \ oss << message; \ logger->trace(oss.str(), __FILE__, __LINE__); }} |
Update of /cvsroot/objecthandler/log4cxx-0.9.7/tests/input In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/tests/input Added Files: Makefile.am defaultInit3.properties hierarchyThreshold1.properties hierarchyThreshold2.properties hierarchyThreshold3.properties hierarchyThreshold4.properties hierarchyThreshold5.properties hierarchyThreshold6.properties hierarchyThreshold7.properties hierarchyThreshold8.properties l7d1.properties patternLayout.mdc.1.properties patternLayout1.properties patternLayout10.properties patternLayout11.properties patternLayout12.properties patternLayout2.properties patternLayout3.properties patternLayout4.properties patternLayout5.properties patternLayout6.properties patternLayout7.properties patternLayout8.properties patternLayout9.properties socketServer1.properties socketServer2.properties socketServer3.properties socketServer4.properties socketServer5.properties socketServer6.properties socketServer7.properties socketServer8.properties Log Message: --- NEW FILE: patternLayout8.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%r [%t] %-5p %.16c - %m%n --- NEW FILE: patternLayout.mdc.1.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%-5p - %m %X --- NEW FILE: socketServer7.properties --- log4j.rootLogger=DEBUG, A log4j.Logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.Logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x %X{hostID} %X{key7} [%t] %c{1} - %m%n --- NEW FILE: patternLayout12.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=[%t] %-5p %F(%L): %m%n --- NEW FILE: patternLayout5.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%d{%d %b %Y %H:%M:%S,%Q} [%t] %-5p %.16c - %m%n --- NEW FILE: patternLayout7.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%d{%H:%M:%S,%Q} [%t] %-5p %.16c - %m%n --- NEW FILE: patternLayout9.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=[%t] %-5p %.16c : %m%n --- NEW FILE: patternLayout1.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.file=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%-5p - %m%n --- NEW FILE: patternLayout2.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append= false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %.16c - %m%n --- NEW FILE: patternLayout3.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S,%Q} [%t] %-5p %.16c - %m%n --- NEW FILE: Makefile.am --- SUBDIRS = xml EXTRA_DIST = *.properties --- NEW FILE: patternLayout11.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%-5p [%t] %c{2}: %m%n --- NEW FILE: patternLayout10.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File= output/temp log4j.appender.testAppender.Append= false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=[%t] %-5p %l: %m%n --- NEW FILE: l7d1.properties --- log4j.rootCategory=INFO, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File= output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=T1 %5p - %m%n --- NEW FILE: socketServer2.properties --- log4j.rootLogger=DEBUG, A log4j.logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x [%t] %F(%L) %m%n --- NEW FILE: defaultInit3.properties --- log4j.rootCategory=DEBUG, D3 log4j.appender.D3=org.apache.log4j.FileAppender log4j.appender.D3.File=output/temp log4j.appender.D3.Append=false log4j.appender.D3.layout=org.apache.log4j.PatternLayout log4j.appender.D3.layout.ConversionPattern=%d [%t] %-5p %.16c - %m%n --- NEW FILE: patternLayout4.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%d{DATE} [%t] %-5p %.16c - %m%n --- NEW FILE: patternLayout6.properties --- log4j.rootCategory=DEBUG, testAppender log4j.appender.testAppender=org.apache.log4j.FileAppender log4j.appender.testAppender.File=output/temp log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%d{ABSOLUTE} [%t] %-5p %.16c - %m%n --- NEW FILE: hierarchyThreshold2.properties --- log4j.threshold=FATAL log4j.rootLogger=,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: socketServer1.properties --- log4j.rootLogger=DEBUG, A log4j.logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x [%t] %c %m%n --- NEW FILE: hierarchyThreshold7.properties --- log4j.threshold=TRACE#org.apache.log4j.xml.XLevel log4j.rootLogger=ALL,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: hierarchyThreshold1.properties --- log4j.threshold=OFF log4j.rootLogger=,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: hierarchyThreshold3.properties --- log4j.threshold=ERROR log4j.rootLogger=,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: hierarchyThreshold4.properties --- log4j.threshold=WARN log4j.rootLogger=,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: hierarchyThreshold6.properties --- log4j.threshold=DEBUG log4j.rootLogger=,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: socketServer6.properties --- log4j.rootLogger=DEBUG, A log4j.Logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.Logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x %X{hostID} %X{key6} [%t] %c{1} - %m%n --- NEW FILE: socketServer3.properties --- log4j.rootLogger=DEBUG, A log4j.Logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.Logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x [%t] %F(%L) %m%n --- NEW FILE: socketServer4.properties --- log4j.rootLogger=DEBUG, A log4j.Logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.Logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x %X{key1}%X{key4} [%t] %c{1} - %m%n --- NEW FILE: socketServer8.properties --- log4j.rootLogger=DEBUG, A log4j.Logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.Logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x %X{hostID} %X{key8} [%t] %c{1} - %m%n --- NEW FILE: hierarchyThreshold8.properties --- log4j.threshold=ALL log4j.rootLogger=ALL,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: hierarchyThreshold5.properties --- log4j.threshold=INFO log4j.rootLogger=,A log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.File=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%p %c = %m%n --- NEW FILE: socketServer5.properties --- log4j.rootLogger=DEBUG, A log4j.Logger.org.apache.log4j.test.ShortSocketServer=WARN log4j.Logger.org.apache.log4j.net.SocketNode=WARN log4j.appender.A=org.apache.log4j.FileAppender log4j.appender.A.file=output/temp log4j.appender.A.Append=false log4j.appender.A.layout=org.apache.log4j.PatternLayout log4j.appender.A.layout.ConversionPattern=%5p %x %X{key1}%X{key5} [%t] %c{1} - %m%n |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:51
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/msvc/static In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/msvc/static Added Files: Makefile.am static.cpp static.dsp static.vcproj static_vc8.vcproj Log Message: --- NEW FILE: static.cpp --- #include <log4cxx/config.h> #include <log4cxx/helpers/boundedfifo.h> #include <log4cxx/asyncappender.h> #include <log4cxx/consoleappender.h> #include <log4cxx/dailyrollingfileappender.h> #include <log4cxx/htmllayout.h> #include <log4cxx/level.h> #include <log4cxx/patternlayout.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/rollingfileappender.h> #include <log4cxx/simplelayout.h> #include <log4cxx/ttcclayout.h> #include <log4cxx/db/odbcappender.h> #include <log4cxx/helpers/appenderattachableimpl.h> #include <log4cxx/helpers/onlyonceerrorhandler.h> #include <log4cxx/net/smtpappender.h> #include <log4cxx/net/socketappender.h> #include <log4cxx/net/sockethubappender.h> #include <log4cxx/helpers/datagramsocket.h> #include <log4cxx/net/syslogappender.h> #include <log4cxx/net/telnetappender.h> #include <log4cxx/net/xmlsocketappender.h> #include <log4cxx/nt/nteventlogappender.h> #include <log4cxx/spi/loggingevent.h> #include <log4cxx/varia/denyallfilter.h> #include <log4cxx/varia/fallbackerrorhandler.h> #include <log4cxx/varia/levelmatchfilter.h> #include <log4cxx/varia/levelrangefilter.h> #include <log4cxx/varia/stringmatchfilter.h> #include <log4cxx/xml/domconfigurator.h> #include <log4cxx/xml/xmllayout.h> using namespace log4cxx; using namespace log4cxx::db; using namespace log4cxx::helpers; using namespace log4cxx::net; using namespace log4cxx::nt; using namespace log4cxx::spi; using namespace log4cxx::varia; using namespace log4cxx::xml; /** Special function used to force symbol references for dynamic classes when comiling a static library with msvc. <b>This function must not be called directly !</b> */ void ForceSymbolReferences() { AsyncAppender(); ConsoleAppender(); DailyRollingFileAppender(); FileAppender(); HTMLLayout(); PatternLayout(); PropertyConfigurator(); RollingFileAppender(); SimpleLayout(); TTCCLayout(); #ifdef HAVE_ODBC ODBCAppender(); #endif AppenderAttachableImpl(); OnlyOnceErrorHandler(); #ifdef HAVE_SMTP SMTPAppender(); DefaultEvaluator(); #endif SocketAppender(); SocketHubAppender(); SyslogAppender(); TelnetAppender(); XMLSocketAppender(); NTEventLogAppender(); LoggingEvent(); DenyAllFilter(); FallbackErrorHandler(); LevelMatchFilter(); LevelRangeFilter(); StringMatchFilter(); #ifdef HAVE_XML DOMConfigurator(); #endif XMLLayout(); } --- NEW FILE: static.dsp --- # Microsoft Developer Studio Project File - Name="static" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=static - Win32 Debug CRTDLL !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "static.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "static.mak" CFG="static - Win32 Debug CRTDLL" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE [...1174 lines suppressed...] # End Source File # Begin Source File SOURCE=..\..\include\log4cxx\rollingfileappender.h # End Source File # Begin Source File SOURCE=..\..\include\log4cxx\simplelayout.h # End Source File # Begin Source File SOURCE=..\..\include\log4cxx\ttcclayout.h # End Source File # Begin Source File SOURCE=..\..\include\log4cxx\writerappender.h # End Source File # End Group # End Target # End Project --- NEW FILE: static.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="static" ProjectGUID="{7BC0D5CE-5FCE-4713-A16D-6CDDAF03ADDA}" SccProjectName="" SccLocalPath=""> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Unicode Release|Win32" OutputDirectory=".\Unicode_R" IntermediateDirectory=".\Unicode_R" ConfigurationType="4" UseOfMFC="0" [...5824 lines suppressed...] </File> <File RelativePath="..\..\include\log4cxx\varia\stringmatchfilter.h"> </File> </Filter> <Filter Name="xml" Filter="h"> <File RelativePath="..\..\include\log4cxx\xml\domconfigurator.h"> </File> <File RelativePath="..\..\include\log4cxx\xml\xmllayout.h"> </File> </Filter> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: Makefile.am --- EXTRA_DIST = static.cpp static.dsp static.vcproj --- NEW FILE: static_vc8.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="static" ProjectGUID="{495708AC-96C6-41E5-AD66-4AFD16C27A21}" RootNamespace="static" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Unicode Release|Win32" OutputDirectory=".\Unicode_R" [...5702 lines suppressed...] </File> </Filter> <Filter Name="xml" Filter="h" > <File RelativePath="..\..\include\log4cxx\xml\domconfigurator.h" > </File> <File RelativePath="..\..\include\log4cxx\xml\xmllayout.h" > </File> </Filter> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:51
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/msvc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/msvc Added Files: Makefile.am log4cxx.dsw log4cxx.opt log4cxx.sln log4cxx_vc8.sln Log Message: --- NEW FILE: log4cxx.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "simplesocketserver"=.\simplesocketserver\simplesocketserver.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dll End Project Dependency }}} ############################################################################### Project: "static"=.\static\static.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### --- NEW FILE: log4cxx.opt --- (This appears to be a binary file; contents omitted.) --- NEW FILE: log4cxx.sln --- Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simplesocketserver", "simplesocketserver\simplesocketserver.vcproj", "{A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}" ProjectSection(ProjectDependencies) = postProject {A4E44A07-5436-4BE3-BAEA-C7994AD3D829} = {A4E44A07-5436-4BE3-BAEA-C7994AD3D829} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "static", "static\static.vcproj", "{495708AC-96C6-41E5-AD66-4AFD16C27A21}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Debug CRDLL = Debug CRDLL Debug Single Thread = Debug Single Thread Release = Release Release CRTDLL = Release CRTDLL Release Single Thread = Release Single Thread Unicode Debug = Unicode Debug Unicode Release = Unicode Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug.ActiveCfg = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug.Build.0 = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug CRDLL.ActiveCfg = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug CRDLL.Build.0 = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug Single Thread.ActiveCfg = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug Single Thread.Build.0 = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release.ActiveCfg = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release.Build.0 = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release CRTDLL.ActiveCfg = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release CRTDLL.Build.0 = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release Single Thread.ActiveCfg = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release Single Thread.Build.0 = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Debug.Build.0 = Unicode Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Release.ActiveCfg = Unicode Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Release.Build.0 = Unicode Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug.ActiveCfg = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug.Build.0 = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug CRDLL.ActiveCfg = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug CRDLL.Build.0 = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug Single Thread.ActiveCfg = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug Single Thread.Build.0 = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release.ActiveCfg = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release.Build.0 = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release CRTDLL.ActiveCfg = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release CRTDLL.Build.0 = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release Single Thread.ActiveCfg = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release Single Thread.Build.0 = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Debug.Build.0 = Unicode Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Release.ActiveCfg = Unicode Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Release.Build.0 = Unicode Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug.ActiveCfg = Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug.Build.0 = Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug CRDLL.ActiveCfg = Debug CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug CRDLL.Build.0 = Debug CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug Single Thread.ActiveCfg = Debug Single Thread|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug Single Thread.Build.0 = Debug Single Thread|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release.ActiveCfg = Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release.Build.0 = Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release CRTDLL.ActiveCfg = Release CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release CRTDLL.Build.0 = Release CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release Single Thread.ActiveCfg = Release Single Thread|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release Single Thread.Build.0 = Release Single Thread|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Debug.ActiveCfg = Unicode Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Debug.Build.0 = Unicode Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Release.ActiveCfg = Unicode Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Release.Build.0 = Unicode Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal --- NEW FILE: Makefile.am --- SUBDIRS = simplesocketserver static tests performance examples EXTRA_DIST = log4cxx.dsw log4cxx.sln --- NEW FILE: log4cxx_vc8.sln --- Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simplesocketserver", "simplesocketserver\simplesocketserver_vc8.vcproj", "{A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}" ProjectSection(ProjectDependencies) = postProject {A4E44A07-5436-4BE3-BAEA-C7994AD3D829} = {A4E44A07-5436-4BE3-BAEA-C7994AD3D829} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "static", "static\static_vc8.vcproj", "{495708AC-96C6-41E5-AD66-4AFD16C27A21}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug CRTDLL|Win32 = Debug CRTDLL|Win32 Debug|Win32 = Debug|Win32 Release CRTDLL|Win32 = Release CRTDLL|Win32 Release|Win32 = Release|Win32 Unicode Debug|Win32 = Unicode Debug|Win32 Unicode Release|Win32 = Unicode Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug CRTDLL|Win32.ActiveCfg = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug CRTDLL|Win32.Build.0 = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug|Win32.ActiveCfg = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug|Win32.Build.0 = Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release CRTDLL|Win32.ActiveCfg = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release CRTDLL|Win32.Build.0 = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release|Win32.ActiveCfg = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release|Win32.Build.0 = Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug CRTDLL|Win32.ActiveCfg = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug CRTDLL|Win32.Build.0 = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug|Win32.ActiveCfg = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug|Win32.Build.0 = Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release CRTDLL|Win32.ActiveCfg = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release CRTDLL|Win32.Build.0 = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release|Win32.ActiveCfg = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release|Win32.Build.0 = Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug CRTDLL|Win32.ActiveCfg = Debug CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug CRTDLL|Win32.Build.0 = Debug CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug|Win32.ActiveCfg = Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug|Win32.Build.0 = Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release CRTDLL|Win32.ActiveCfg = Release CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release CRTDLL|Win32.Build.0 = Release CRTDLL|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release|Win32.ActiveCfg = Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release|Win32.Build.0 = Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:51
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/msvc/performance In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/msvc/performance Added Files: Makefile.am logging.dsp logging.vcproj Log Message: --- NEW FILE: logging.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="logging" ProjectGUID="{049F3A59-98D0-4237-BF7A-42518C49695C}" SccProjectName="" SccLocalPath=""> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Debug/logging.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Debug/logging.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="../lib/debug" GenerateDebugInformation="TRUE" ProgramDatabaseFile="../Bin/Debug/logging.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Debug/logging.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="2" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Release/logging.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Release/logging.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="../lib/release" GenerateDebugInformation="TRUE" ProgramDatabaseFile="../Bin/Release/logging.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Release/logging.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> <File RelativePath="..\..\performance\main.cpp"> </File> <File RelativePath="..\..\performance\nullappender.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" PreprocessorDefinitions="" BasicRuntimeChecks="3"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" Optimization="2" AdditionalIncludeDirectories="" PreprocessorDefinitions=""/> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl"> <File RelativePath="..\..\performance\nullappender.h"> </File> </Filter> <Filter Name="Resource Files" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: logging.dsp --- # Microsoft Developer Studio Project File - Name="logging" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=logging - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "logging.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "logging.mak" CFG="logging - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "logging - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "logging - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "logging - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 log4cxx.lib ole32.lib /nologo /subsystem:console /pdb:"../Bin/Release/logging.pdb" /debug /machine:I386 /out:"../Bin/Release/logging.exe" /pdbtype:sept /libpath:"../lib/release" !ELSEIF "$(CFG)" == "logging - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 log4cxx.lib ole32.lib /nologo /subsystem:console /pdb:"../Bin/Debug/logging.pdb" /debug /machine:I386 /out:"../Bin/Debug/logging.exe" /pdbtype:sept /libpath:"../lib/debug" !ENDIF # Begin Target # Name "logging - Win32 Release" # Name "logging - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\performance\main.cpp # End Source File # Begin Source File SOURCE=..\..\performance\nullappender.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\performance\nullappender.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: Makefile.am --- EXTRA_DIST = logging.dsp logging.vcproj |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:50
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/msvc/simplesocketserver In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/msvc/simplesocketserver Added Files: Makefile.am simplesocketserver.dsp simplesocketserver.vcproj simplesocketserver_vc8.vcproj Log Message: --- NEW FILE: simplesocketserver_vc8.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="simplesocketserver" ProjectGUID="{A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Unicode Debug|Win32" OutputDirectory=".\Unicode_D" IntermediateDirectory=".\Unicode_D" ConfigurationType="1" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TypeLibraryName=".\Unicode_D/simplesocketserver.tlb" HeaderFileName="" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;UNICODE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" PrecompiledHeaderFile=".\Unicode_D/simplesocketserver.pch" AssemblerListingLocation=".\Unicode_D/" ObjectFile=".\Unicode_D/" ProgramDataBaseFileName=".\Unicode_D/" WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="3" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1036" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Unicode_D/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="true" AdditionalLibraryDirectories="../lib/unicode_d" GenerateDebugInformation="true" ProgramDatabaseFile="../Bin/Unicode_D/simplesocketserver.pdb" SubSystem="1" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="1" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TypeLibraryName=".\Release/simplesocketserver.tlb" HeaderFileName="" /> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="true" RuntimeLibrary="1" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" PrecompiledHeaderFile=".\Release/simplesocketserver.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="3" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1036" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Release/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="true" AdditionalLibraryDirectories="../lib/release" GenerateDebugInformation="true" ProgramDatabaseFile="../Bin/Release/simplesocketserver.pdb" SubSystem="1" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="1" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TypeLibraryName=".\Debug/simplesocketserver.tlb" HeaderFileName="" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" PrecompiledHeaderFile=".\Debug/simplesocketserver.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="3" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1036" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Debug/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="true" AdditionalLibraryDirectories="../lib/debug" GenerateDebugInformation="true" ProgramDatabaseFile="../Bin/Debug/simplesocketserver.pdb" SubSystem="1" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Unicode Release|Win32" OutputDirectory=".\Unicode_R" IntermediateDirectory=".\Unicode_R" ConfigurationType="1" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TypeLibraryName=".\Unicode_R/simplesocketserver.tlb" HeaderFileName="" /> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;UNICODE" StringPooling="true" RuntimeLibrary="1" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" PrecompiledHeaderFile=".\Unicode_R/simplesocketserver.pch" AssemblerListingLocation=".\Unicode_R/" ObjectFile=".\Unicode_R/" ProgramDataBaseFileName=".\Unicode_R/" WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="3" CompileAs="0" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1036" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Unicode_R/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="true" AdditionalLibraryDirectories="../lib/unicode_r" GenerateDebugInformation="true" ProgramDatabaseFile="../Bin/Unicode_R/simplesocketserver.pdb" SubSystem="1" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > <File RelativePath="..\..\src\simplesocketserver.cpp" > <FileConfiguration Name="Unicode Debug|Win32" > <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" PreprocessorDefinitions="" BasicRuntimeChecks="3" /> </FileConfiguration> <FileConfiguration Name="Release|Win32" > <Tool Name="VCCLCompilerTool" Optimization="2" AdditionalIncludeDirectories="" PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration Name="Debug|Win32" > <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" PreprocessorDefinitions="" BasicRuntimeChecks="3" /> </FileConfiguration> <FileConfiguration Name="Unicode Release|Win32" > <Tool Name="VCCLCompilerTool" Optimization="2" AdditionalIncludeDirectories="" PreprocessorDefinitions="" /> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl" > </Filter> <Filter Name="Resource Files" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" > </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: simplesocketserver.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="simplesocketserver" ProjectGUID="{CDACA6B7-9482-48D2-97D7-D798A108D3C4}" SccProjectName="" SccLocalPath=""> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Unicode Debug|Win32" OutputDirectory=".\Unicode_D" IntermediateDirectory=".\Unicode_D" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;UNICODE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Unicode_D/simplesocketserver.pch" AssemblerListingLocation=".\Unicode_D/" ObjectFile=".\Unicode_D/" ProgramDataBaseFileName=".\Unicode_D/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Unicode_D/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="../lib/unicode_d" GenerateDebugInformation="TRUE" ProgramDatabaseFile="../Bin/Unicode_D/simplesocketserver.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Unicode_D/simplesocketserver.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Release/simplesocketserver.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Release/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="../lib/release" GenerateDebugInformation="TRUE" ProgramDatabaseFile="../Bin/Release/simplesocketserver.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Release/simplesocketserver.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Debug/simplesocketserver.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Debug/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="../lib/debug" GenerateDebugInformation="TRUE" ProgramDatabaseFile="../Bin/Debug/simplesocketserver.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Debug/simplesocketserver.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Unicode Release|Win32" OutputDirectory=".\Unicode_R" IntermediateDirectory=".\Unicode_R" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;UNICODE" StringPooling="TRUE" RuntimeLibrary="1" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Unicode_R/simplesocketserver.pch" AssemblerListingLocation=".\Unicode_R/" ObjectFile=".\Unicode_R/" ProgramDataBaseFileName=".\Unicode_R/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Unicode_R/simplesocketserver.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="../lib/unicode_r" GenerateDebugInformation="TRUE" ProgramDatabaseFile="../Bin/Unicode_R/simplesocketserver.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Unicode_R/simplesocketserver.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> <File RelativePath="..\..\src\simplesocketserver.cpp"> <FileConfiguration Name="Unicode Debug|Win32"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" PreprocessorDefinitions="" BasicRuntimeChecks="3"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" Optimization="2" AdditionalIncludeDirectories="" PreprocessorDefinitions=""/> </FileConfiguration> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" PreprocessorDefinitions="" BasicRuntimeChecks="3"/> </FileConfiguration> <FileConfiguration Name="Unicode Release|Win32"> <Tool Name="VCCLCompilerTool" Optimization="2" AdditionalIncludeDirectories="" PreprocessorDefinitions=""/> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl"> </Filter> <Filter Name="Resource Files" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: simplesocketserver.dsp --- # Microsoft Developer Studio Project File - Name="simplesocketserver" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=simplesocketserver - Win32 Unicode Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "simplesocketserver.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "simplesocketserver.mak" CFG="simplesocketserver - Win32 Unicode Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "simplesocketserver - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "simplesocketserver - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "simplesocketserver - Win32 Unicode Release" (based on "Win32 (x86) Console Application") !MESSAGE "simplesocketserver - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "simplesocketserver - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MTd /W3 /GX /Zi /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 ole32.lib log4cxx.lib /nologo /subsystem:console /pdb:"../Bin/Release/simplesocketserver.pdb" /debug /machine:I386 /out:"../Bin/Release/simplesocketserver.exe" /libpath:"../lib/release" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "simplesocketserver - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 ole32.lib log4cxx.lib /nologo /subsystem:console /pdb:"../Bin/Debug/simplesocketserver.pdb" /debug /machine:I386 /out:"../Bin/Debug/simplesocketserver.exe" /pdbtype:sept /libpath:"../lib/debug" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "simplesocketserver - Win32 Unicode Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "simplesocketserver___Win32_Unicode_Release" # PROP BASE Intermediate_Dir "simplesocketserver___Win32_Unicode_Release" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Unicode_R" # PROP Intermediate_Dir "Unicode_R" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MTd /W3 /GX /Zi /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ole32.lib log4cxx.lib /nologo /subsystem:console /machine:I386 /libpath:"../lib/release" # ADD LINK32 ole32.lib log4cxx.lib /nologo /subsystem:console /pdb:"../Bin/Unicode_R/simplesocketserver.pdb" /debug /machine:I386 /out:"../Bin/Unicode_R/simplesocketserver.exe" /libpath:"../lib/unicode_r" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "simplesocketserver - Win32 Unicode Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "simplesocketserver___Win32_Unicode_Debug" # PROP BASE Intermediate_Dir "simplesocketserver___Win32_Unicode_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Unicode_D" # PROP Intermediate_Dir "Unicode_D" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ole32.lib log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../lib/debug" # ADD LINK32 ole32.lib log4cxx.lib /nologo /subsystem:console /pdb:"../Bin/Unicode_D/simplesocketserver.pdb" /debug /machine:I386 /out:"../Bin/Unicode_D/simplesocketserver.exe" /pdbtype:sept /libpath:"../lib/unicode_d" # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "simplesocketserver - Win32 Release" # Name "simplesocketserver - Win32 Debug" # Name "simplesocketserver - Win32 Unicode Release" # Name "simplesocketserver - Win32 Unicode Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\src\simplesocketserver.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: Makefile.am --- EXTRA_DIST = simplesocketserver.dsp simplesocketserver.vcproj |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:50
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx/xml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx/xml Added Files: Makefile.am domconfigurator.h xmllayout.h Log Message: --- NEW FILE: domconfigurator.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_XML_DOM_CONFIGURATOR_H #define _LOG4CXX_XML_DOM_CONFIGURATOR_H #include <log4cxx/config.h> #ifdef HAVE_XML #include <log4cxx/helpers/tchar.h> #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/objectimpl.h> #include <map> #include <log4cxx/appender.h> #include <log4cxx/layout.h> #include <log4cxx/logger.h> #include <log4cxx/helpers/properties.h> #include <log4cxx/spi/configurator.h> namespace log4cxx { namespace spi { class LoggerRepository; typedef helpers::ObjectPtrT<LoggerRepository> LoggerRepositoryPtr; class Filter; typedef helpers::ObjectPtrT<Filter> FilterPtr; class AppenderAttachable; typedef helpers::ObjectPtrT<AppenderAttachable> AppenderAttachablePtr; class OptionHandler; typedef helpers::ObjectPtrT<OptionHandler> OptionHandlerPtr; } namespace helpers { class XMLDOMDocument; typedef helpers::ObjectPtrT<XMLDOMDocument> XMLDOMDocumentPtr; class XMLDOMElement; typedef helpers::ObjectPtrT<XMLDOMElement> XMLDOMElementPtr; } namespace config { class PropertySetter; } namespace xml { class AppenderMap { public: AppenderPtr get(const String& appenderName); void put(const String& appenderName, AppenderPtr appender); protected: std::map<String, AppenderPtr> map; }; /** Use this class to initialize the log4cxx environment using a DOM tree. <p>Sometimes it is useful to see how log4cxx is reading configuration files. You can enable log4cxx internal logging by setting the <code>debug</code> attribute in the <code>log4cxx</code> element. As in <pre> <log4j:configuration <b>debug="true"</b> xmlns:log4j="http://jakarta.apache.org/log4j/"> ... </log4j:configuration> </pre> <p>There are sample XML files included in the package. */ class LOG4CXX_EXPORT DOMConfigurator : virtual public spi::Configurator, virtual public helpers::ObjectImpl { protected: /** Used internally to parse appenders by IDREF name. */ AppenderPtr findAppenderByName(helpers::XMLDOMDocumentPtr doc, const String& appenderName); /** Used internally to parse appenders by IDREF element. */ AppenderPtr findAppenderByReference( helpers::XMLDOMElementPtr appenderRef); /** Used internally to parse an appender element. */ AppenderPtr parseAppender(helpers::XMLDOMElementPtr appenderElement); /** Used internally to parse an {@link spi::ErrorHandler ErrorHandler } element. */ void parseErrorHandler(helpers::XMLDOMElementPtr element, AppenderPtr appender); /** Used internally to parse a filter element. */ void parseFilters(helpers::XMLDOMElementPtr element, AppenderPtr appender); /** Used internally to parse a logger element. */ void parseLogger(helpers::XMLDOMElementPtr loggerElement); /** Used internally to parse the logger factory element. */ void parseLoggerFactory(helpers::XMLDOMElementPtr factoryElement); /** Used internally to parse the roor category element. */ void parseRoot(helpers::XMLDOMElementPtr rootElement); /** Used internally to parse the children of a category element. */ void parseChildrenOfLoggerElement(helpers::XMLDOMElementPtr catElement, LoggerPtr logger, bool isRoot); /** Used internally to parse a layout element. */ LayoutPtr parseLayout(helpers::XMLDOMElementPtr layout_element); /** Used internally to parse a level element. */ void parseLevel(helpers::XMLDOMElementPtr element, LoggerPtr logger, bool isRoot); void setParameter(helpers::XMLDOMElementPtr elem, config::PropertySetter& propSetter); /** Used internally to configure the log4cxx framework by parsing a DOM tree of XML elements based on <a href="docs/log4j.dtd">log4j.dtd</a>. */ void parse(helpers::XMLDOMElementPtr element); public: DECLARE_LOG4CXX_OBJECT(DOMConfigurator) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(spi::Configurator) END_LOG4CXX_CAST_MAP() /** A static version of #doConfigure. */ static void configure(const String& filename); /** Like #configureAndWatch(const String& configFilename, long delay) except that the default delay as defined by FileWatchdog#DEFAULT_DELAY is used. @param configFilename A log4j configuration file in XML format. */ static void configureAndWatch(const String& configFilename); /** Read the configuration file <code>configFilename</code> if it exists. Moreover, a thread will be created that will periodically check if <code>configFilename</code> has been created or modified. The period is determined by the <code>delay</code> argument. If a change or file creation is detected, then <code>configFilename</code> is read to configure log4cxx. @param configFilename A log4j configuration file in XML format. @param delay The delay in milliseconds to wait between each check. */ static void configureAndWatch(const String& configFilename, long delay); /** Interpret the XML file pointed by <code>filename</code> and set up log4cxx accordingly. <p>The configuration is done relative to the hierarchy parameter. @param filename The file to parse. @param repository The hierarchy to operation upon. */ void doConfigure(const String& filename, spi::LoggerRepositoryPtr& repository); protected: String DOMConfigurator::subst(const String& value); protected: void * appenderBag; helpers::Properties props; spi::LoggerRepositoryPtr repository; spi::LoggerFactoryPtr loggerFactory; }; } // namespace xml }; // namespace log4cxx #endif // HAVE_XML #endif // _LOG4CXX_XML_DOM_CONFIGURATOR_H --- NEW FILE: Makefile.am --- xmlincdir = $(includedir)/log4cxx/xml xmlinc_HEADERS= $(top_srcdir)/include/log4cxx/xml/*.h --- NEW FILE: xmllayout.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_XML_LAYOUT_H #define _LOG4CXX_XML_LAYOUT_H #include <log4cxx/layout.h> namespace log4cxx { namespace xml { class XMLLayout; typedef helpers::ObjectPtrT<XMLLayout> XMLLayoutPtr; /** The output of the XMLLayout consists of a series of log4j:event elements as defined in the <a href="doc-files/log4j.dtd">log4j.dtd</a>. It does not output a complete well-formed XML file. The output is designed to be included as an <em>external entity</em> in a separate file to form a correct XML file. <p>For example, if <code>abc</code> is the name of the file where the XMLLayout ouput goes, then a well-formed XML file would be: <code> <?xml version="1.0" ?> <!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd" [<!ENTITY data SYSTEM "abc">]> <log4j:eventSet version="1.2" xmlns:log4j="http://jakarta.apache.org/log4j/"> @&data; </log4j:eventSet> </code> <p>This approach enforces the independence of the XMLLayout and the appender where it is embedded. */ class LOG4CXX_EXPORT XMLLayout : public Layout { private: /** A string constant used in naming the option for setting the the location information flag. Current value of this string constant is <b>LocationInfo</b>. */ static String LOCATION_INFO_OPTION; // Print no location info by default bool locationInfo; //= false public: DECLARE_LOG4CXX_OBJECT(XMLLayout) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(XMLLayout) LOG4CXX_CAST_ENTRY_CHAIN(Layout) END_LOG4CXX_CAST_MAP() XMLLayout(); /** The <b>LocationInfo</b> option takes a boolean value. By default, it is set to false which means there will be no location information output by this layout. If the the option is set to true, then the file name and line number of the statement at the origin of the log statement will be output. <p>If you are embedding this layout within a SMTPAppender then make sure to set the <b>LocationInfo</b> option of that appender as well. */ inline void setLocationInfo(bool locationInfo) { this->locationInfo = locationInfo; } /** Returns the current value of the <b>LocationInfo</b> option. */ inline bool getLocationInfo() const { return locationInfo; } /** No options to activate. */ void activateOptions() { } /** Set options */ virtual void setOption(const String& option, const String& value); /** * Formats a {@link spi::LoggingEvent LoggingEvent} * in conformance with the log4cxx.dtd. **/ virtual void format(ostream& output, const spi::LoggingEventPtr& event) const; /** The XMLLayout prints and does not ignore exceptions. Hence the return value <code>false</code>. */ virtual bool ignoresThrowable() const { return false; } }; // class XMLLayout } // namespace xml }; // namespace log4cxx #endif // _LOG4CXX_XML_LAYOUT_H |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:47
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx/net In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx/net Added Files: Makefile.am smtpappender.h socketappender.h sockethubappender.h socketnode.h syslogappender.h telnetappender.h xmlsocketappender.h Log Message: --- NEW FILE: telnetappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NET_TELNET_APPENDER_H #define _LOG4CXX_NET_TELNET_APPENDER_H #include <log4cxx/appenderskeleton.h> #include <log4cxx/helpers/socket.h> #include <log4cxx/helpers/serversocket.h> #include <log4cxx/helpers/thread.h> #include <vector> namespace log4cxx { namespace helpers { class SocketOutputStream; typedef helpers::ObjectPtrT<SocketOutputStream> SocketOutputStreamPtr; } namespace net { /** <p>The TelnetAppender is a log4cxx appender that specializes in writing to a read-only socket. The output is provided in a telnet-friendly way so that a log can be monitored over TCP/IP. Clients using telnet connect to the socket and receive log data. This is handy for remote monitoring, especially when monitoring a servlet. <p>Here is a list of the available configuration options: <table border=1> <tr> <td align=center><b>Name</b></td> <td align=center><b>Requirement</b></td> <td align=center><b>Description</b></td> <td align=center><b>Sample Value</b></td> </tr> <tr> <td>Port</td> <td>optional</td> <td>This parameter determines the port to use for announcing log events. The default port is 23 (telnet).</td> <td>5875</td> </table> */ class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton { class SocketHandler; friend class SocketHandler; private: static int DEFAULT_PORT; SocketHandler * sh; int port; public: DECLARE_LOG4CXX_OBJECT(TelnetAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(TelnetAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() TelnetAppender(); ~TelnetAppender(); /** This appender requires a layout to format the text to the attached client(s). */ virtual bool requiresLayout() const { return true; } /** all of the options have been set, create the socket handler and wait for connections. */ void activateOptions(); /** Set options */ virtual void setOption(const String& option, const String& value); /** Returns value of the <b>Port</b> option. */ int getPort() const { return port; } /** The <b>Port</b> option takes a positive integer representing the port where the server is waiting for connections. */ void setPort(int port) { this->port = port; } /** shuts down the appender. */ void close(); protected: /** Handles a log event. For this appender, that means writing the message to each connected client. */ virtual void append(const spi::LoggingEventPtr& event) ; //---------------------------------------------------------- SocketHandler: private: /** The SocketHandler class is used to accept connections from clients. It is threaded so that clients can connect/disconnect asynchronously. */ class LOG4CXX_EXPORT SocketHandler : public helpers::Thread { private: bool done; std::vector<helpers::SocketOutputStreamPtr> writers; std::vector<helpers::SocketPtr> connections; helpers::ServerSocket serverSocket; std::vector<helpers::SocketPtr>::size_type MAX_CONNECTIONS; public: SocketHandler(int port); /** make sure we close all network connections when this handler is destroyed. */ void finalize(); /** sends a message to each of the clients in telnet-friendly output. */ void send(const String& message); /** Continually accepts client connections. Client connections are refused when MAX_CONNECTIONS is reached. */ virtual void run(); protected: void print(helpers::SocketOutputStreamPtr& os, const String& sz); }; // class SocketHandler }; // class TelnetAppender } // namespace net }; // namespace log4cxx #endif // _LOG4CXX_NET_TELNET_APPENDER_H --- NEW FILE: socketappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NET_SOCKET_APPENDER_H #define _LOG4CXX_NET_SOCKET_APPENDER_H #include <log4cxx/appenderskeleton.h> #include <log4cxx/helpers/socket.h> #include <log4cxx/helpers/thread.h> namespace log4cxx { namespace helpers { class SocketOutputStream; typedef helpers::ObjectPtrT<SocketOutputStream> SocketOutputStreamPtr; } namespace net { class LOG4CXX_EXPORT SocketAppender; typedef helpers::ObjectPtrT<SocketAppender> SocketAppenderPtr; /** Sends {@link spi::LoggingEvent LoggingEvent} objects to a remote a log server, usually a {@link net::SocketNode SocketNode}. <p>The SocketAppender has the following properties: - If sent to a {@link net::SocketNode SocketNode}, remote logging is non-intrusive as far as the log event is concerned. In other words, the event will be logged with the same time stamp, {@link NDC NDC}, location info as if it were logged locally by the client. - SocketAppenders do not use a layout. They ship a serialized {@link spi::LoggingEvent LoggingEvent} object to the server side. - Remote logging uses the TCP protocol. Consequently, if the server is reachable, then log events will eventually arrive at the server. - If the remote server is down, the logging requests are simply dropped. However, if and when the server comes back up, then event transmission is resumed transparently. This transparent reconneciton is performed by a <em>connector</em> thread which periodically attempts to connect to the server. - Logging events are automatically <em>buffered</em> by the native TCP implementation. This means that if the link to server is slow but still faster than the rate of (log) event production by the client, the client will not be affected by the slow network connection. However, if the network connection is slower then the rate of event production, then the client can only progress at the network rate. In particular, if the network link to the the server is down, the client will be blocked. @n @n On the other hand, if the network link is up, but the server is down, the client will not be blocked when making log requests but the log events will be lost due to server unavailability. - Even if a <code>SocketAppender</code> is no longer attached to any logger, it will not be destroyed in the presence of a connector thread. A connector thread exists only if the connection to the server is down. To avoid this destruction problem, you should #close the the <code>SocketAppender</code> explicitly. See also next item. @n @n Long lived applications which create/destroy many <code>SocketAppender</code> instances should be aware of this destruction problem. Most other applications can safely ignore it. - If the application hosting the <code>SocketAppender</code> exits before the <code>SocketAppender</code> is closed either explicitly or subsequent to destruction, then there might be untransmitted data in the pipe which might be lost. @n @n To avoid lost data, it is usually sufficient to #close the <code>SocketAppender</code> either explicitly or by calling the LogManager#shutdown method before exiting the application. */ class LOG4CXX_EXPORT SocketAppender : public AppenderSkeleton { class Connector; friend class Connector; public: /** The default port number of remote logging server (4560). */ static int DEFAULT_PORT; /** The default reconnection delay (30000 milliseconds or 30 seconds). */ static int DEFAULT_RECONNECTION_DELAY; protected: /** host name */ String remoteHost; /** IP address */ helpers::InetAddress address; int port; helpers::SocketOutputStreamPtr os; int reconnectionDelay; bool locationInfo; public: DECLARE_LOG4CXX_OBJECT(SocketAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(SocketAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() SocketAppender(); ~SocketAppender(); /** Connects to remote server at <code>address</code> and <code>port</code>. */ SocketAppender(unsigned long address, int port); /** Connects to remote server at <code>host</code> and <code>port</code>. */ SocketAppender(const String& host, int port); /** Connect to the specified <b>RemoteHost</b> and <b>Port</b>. */ void activateOptions(); /** Set options */ virtual void setOption(const String& option, const String& value); /** * Close this appender. * * <p>This will mark the appender as closed and call then * #cleanUp method. * */ void close(); /** * Drop the connection to the remote host and release the underlying * connector thread if it has been created * */ void cleanUp(); void connect(); virtual void append(const spi::LoggingEventPtr& event); /** * The SocketAppender does not use a layout. Hence, this method * returns <code>false</code>. * */ bool requiresLayout() const { return false; } /** * The <b>RemoteHost</b> option takes a string value which should be * the host name of the server where a * {@link net::SocketNode SocketNode} is running. * */ inline void setRemoteHost(const String& host) { address = helpers::InetAddress::getByName(host); remoteHost = host; } /** Returns value of the <b>RemoteHost</b> option. */ inline const String& getRemoteHost() const { return remoteHost; } /** The <b>Port</b> option takes a positive integer representing the port where the server is waiting for connections. */ void setPort(int port) { this->port = port; } /** Returns value of the <b>Port</b> option. */ int getPort() const { return port; } /** The <b>LocationInfo</b> option takes a boolean value. If true, the information sent to the remote host will include location information. By default no location information is sent to the server. */ void setLocationInfo(bool locationInfo) { this->locationInfo = locationInfo; } /** Returns value of the <b>LocationInfo</b> option. */ bool getLocationInfo() const { return locationInfo; } /** The <b>ReconnectionDelay</b> option takes a positive integer representing the number of milliseconds to wait between each failed connection attempt to the server. The default value of this option is 30000 which corresponds to 30 seconds. <p>Setting this option to zero turns off reconnection capability. */ void setReconnectionDelay(int reconnectionDelay) { this->reconnectionDelay = reconnectionDelay; } /** Returns value of the <b>ReconnectionDelay</b> option. */ int getReconnectionDelay() const { return reconnectionDelay; } void fireConnector(); private: /** The Connector will reconnect when the server becomes available again. It does this by attempting to open a new connection every <code>reconnectionDelay</code> milliseconds. <p>It stops trying whenever a connection is established. It will restart to try reconnect to the server when previpously open connection is droppped. */ class LOG4CXX_EXPORT Connector : public helpers::Thread { public: typedef helpers::Thread BASE_CLASS; BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(Connector) LOG4CXX_CAST_ENTRY_CHAIN(BASE_CLASS) END_LOG4CXX_CAST_MAP() bool interrupted; SocketAppender * socketAppender; Connector(SocketAppender * socketAppender); virtual void run(); }; // class Connector typedef helpers::ObjectPtrT<Connector> ConnectorPtr; ConnectorPtr connector; }; // class SocketAppender } // namespace net }; // namespace log4cxx #endif // _LOG4CXX_NET_SOCKET_APPENDER_H --- NEW FILE: xmlsocketappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NET_XML_SOCKET_APPENDER_H #define _LOG4CXX_NET_XML_SOCKET_APPENDER_H #include <log4cxx/appenderskeleton.h> #include <log4cxx/helpers/socket.h> #include <log4cxx/helpers/thread.h> namespace log4cxx { namespace helpers { class SocketOutputStream; typedef helpers::ObjectPtrT<SocketOutputStream> SocketOutputStreamPtr; } namespace net { class XMLSocketAppender; typedef helpers::ObjectPtrT<XMLSocketAppender> XMLSocketAppenderPtr; /** Sends {@link spi::LoggingEvent LoggingEvent} objects in XML format to a remote a log server, usually a XMLSocketNode. <p>The XMLSocketAppender has the following properties: - If sent to a XMLSocketNode, remote logging is non-intrusive as far as the log event is concerned. In other words, the event will be logged with the same time stamp, {@link NDC NDC}, location info as if it were logged locally by the client. - XMLSocketAppenders use exclusively an XMLLayout. They ship an XML stream representing a {@link spi::LoggingEvent LoggingEvent} object to the server side. - Remote logging uses the TCP protocol. Consequently, if the server is reachable, then log events will eventually arrive at the server. - If the remote server is down, the logging requests are simply dropped. However, if and when the server comes back up, then event transmission is resumed transparently. This transparent reconneciton is performed by a <em>connector</em> thread which periodically attempts to connect to the server. - Logging events are automatically <em>buffered</em> by the native TCP implementation. This means that if the link to server is slow but still faster than the rate of (log) event production by the client, the client will not be affected by the slow network connection. However, if the network connection is slower then the rate of event production, then the client can only progress at the network rate. In particular, if the network link to the the server is down, the client will be blocked. @n @n On the other hand, if the network link is up, but the server is down, the client will not be blocked when making log requests but the log events will be lost due to server unavailability. - Even if an <code>XMLSocketAppender</code> is no longer attached to any logger, it will not be destroyed in the presence of a connector thread. A connector thread exists only if the connection to the server is down. To avoid this destruction problem, you should #close the the <code>XMLSocketAppender</code> explicitly. See also next item. @n @n Long lived applications which create/destroy many <code>XMLSocketAppender</code> instances should be aware of this destruction problem. Most other applications can safely ignore it. - If the application hosting the <code>XMLSocketAppender</code> exits before the <code>XMLSocketAppender</code> is closed either explicitly or subsequent to destruction, then there might be untransmitted data in the pipe which might be lost. @n @n To avoid lost data, it is usually sufficient to #close the <code>XMLSocketAppender</code> either explicitly or by calling the LogManager#shutdown method before exiting the application. */ class LOG4CXX_EXPORT XMLSocketAppender : public AppenderSkeleton { class Connector; friend class Connector; public: /** The default port number of remote logging server (4560). */ static int DEFAULT_PORT; /** The default reconnection delay (30000 milliseconds or 30 seconds). */ static int DEFAULT_RECONNECTION_DELAY; protected: /** host name */ String remoteHost; /** IP address */ helpers::InetAddress address; int port; helpers::SocketOutputStreamPtr os; int reconnectionDelay; bool locationInfo; char zeroBuffer[1024]; /** An event XML stream cannot exceed 1024 bytes. */ static const int MAX_EVENT_LEN; public: DECLARE_LOG4CXX_OBJECT(XMLSocketAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(XMLSocketAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() XMLSocketAppender(); ~XMLSocketAppender(); /** Connects to remote server at <code>address</code> and <code>port</code>. */ XMLSocketAppender(unsigned long address, int port); /** Connects to remote server at <code>host</code> and <code>port</code>. */ XMLSocketAppender(const String& host, int port); /** Connect to the specified <b>RemoteHost</b> and <b>Port</b>. */ void activateOptions(); /** Set options */ virtual void setOption(const String& option, const String& value); /** * Close this appender. * * <p>This will mark the appender as closed and call then * #cleanUp method. * */ void close(); /** * Drop the connection to the remote host and release the underlying * connector thread if it has been created * */ void cleanUp(); void connect(); virtual void append(const spi::LoggingEventPtr& event); /** * The XMLSocketAppender use an internal XMLLayout. Hence, this method * returns <code>false</code>. * */ bool requiresLayout() const { return false; } /** * The <b>RemoteHost</b> option takes a string value which should be * the host name of the server where an * XMLSocketNode is running. * */ inline void setRemoteHost(const String& host) { address = helpers::InetAddress::getByName(host); remoteHost = host; } /** Returns value of the <b>RemoteHost</b> option. */ inline const String& getRemoteHost() const { return remoteHost; } /** The <b>Port</b> option takes a positive integer representing the port where the server is waiting for connections. */ void setPort(int port) { this->port = port; } /** Returns value of the <b>Port</b> option. */ int getPort() const { return port; } /** The <b>LocationInfo</b> option takes a boolean value. If true, the information sent to the remote host will include location information. By default no location information is sent to the server. */ void setLocationInfo(bool locationInfo) { this->locationInfo = locationInfo; } /** Returns value of the <b>LocationInfo</b> option. */ bool getLocationInfo() const { return locationInfo; } /** The <b>ReconnectionDelay</b> option takes a positive integer representing the number of milliseconds to wait between each failed connection attempt to the server. The default value of this option is 30000 which corresponds to 30 seconds. <p>Setting this option to zero turns off reconnection capability. */ void setReconnectionDelay(int reconnectionDelay) { this->reconnectionDelay = reconnectionDelay; } /** Returns value of the <b>ReconnectionDelay</b> option. */ int getReconnectionDelay() const { return reconnectionDelay; } void fireConnector(); private: /** The Connector will reconnect when the server becomes available again. It does this by attempting to open a new connection every <code>reconnectionDelay</code> milliseconds. <p>It stops trying whenever a connection is established. It will restart to try reconnect to the server when previpously open connection is droppped. */ class LOG4CXX_EXPORT Connector : public helpers::Thread { public: bool interrupted; XMLSocketAppender * socketAppender; Connector(XMLSocketAppenderPtr socketAppender); virtual void run(); }; // class Connector Connector * connector; }; // class XMLSocketAppender } // namespace net }; // namespace log4cxx #endif // _LOG4CXX_NET_XML_SOCKET_APPENDER_H --- NEW FILE: sockethubappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NET_SOCKET_HUB_APPENDER_H #define _LOG4CXX_NET_SOCKET_HUB_APPENDER_H #include <log4cxx/appenderskeleton.h> #include <log4cxx/helpers/socket.h> #include <log4cxx/helpers/thread.h> #include <vector> #include <log4cxx/helpers/socket.h> namespace log4cxx { namespace helpers { class SocketOutputStream; typedef helpers::ObjectPtrT<SocketOutputStream> SocketOutputStreamPtr; } namespace net { /** Sends {@link spi::LoggingEvent LoggingEvent} objects to a set of remote log servers, usually a SocketNode. <p>Acts just like SocketAppender except that instead of connecting to a given remote log server, <code>SocketHubAppender</code> accepts connections from the remote log servers as clients. It can accept more than one connection. When a log event is received, the event is sent to the set of currently connected remote log servers. Implemented this way it does not require any update to the configuration file to send data to another remote log server. The remote log server simply connects to the host and port the <code>SocketHubAppender</code> is running on. <p>The <code>SocketHubAppender</code> does not store events such that the remote side will events that arrived after the establishment of its connection. Once connected, events arrive in order as guaranteed by the TCP protocol. <p>This implementation borrows heavily from the SocketAppender. <p>The SocketHubAppender has the following characteristics: - If sent to a SocketNode, logging is non-intrusive as far as the log event is concerned. In other words, the event will be logged with the same time stamp, NDC, location info as if it were logged locally. - <code>SocketHubAppender</code> does not use a layout. It ships a serialized spi::LoggingEvent object to the remote side. - <code>SocketHubAppender</code> relies on the TCP protocol. Consequently, if the remote side is reachable, then log events will eventually arrive at remote client. - If no remote clients are attached, the logging requests are simply dropped. - Logging events are automatically <em>buffered</em> by the native TCP implementation. This means that if the link to remote client is slow but still faster than the rate of (log) event production, the application will not be affected by the slow network connection. However, if the network connection is slower then the rate of event production, then the local application can only progress at the network rate. In particular, if the network link to the the remote client is down, the application will be blocked. @n @n On the other hand, if the network link is up, but the remote client is down, the client will not be blocked when making log requests but the log events will be lost due to client unavailability. @n @n The single remote client case extends to multiple clients connections. The rate of logging will be determined by the slowest link. - If the application hosting the <code>SocketHubAppender</code> exits before the <code>SocketHubAppender</code> is closed either explicitly or subsequent to garbage collection, then there might be untransmitted data in the pipe which might be lost. This is a common problem on Windows based systems. @n @n To avoid lost data, it is usually sufficient to #close the <code>SocketHubAppender</code> either explicitly or by calling the LogManager#shutdown method before exiting the application. */ class LOG4CXX_EXPORT SocketHubAppender : public AppenderSkeleton { private: /** The default port number of the ServerSocket will be created on. */ static int DEFAULT_PORT; int port; std::vector<helpers::SocketOutputStreamPtr> oosList; bool locationInfo; public: DECLARE_LOG4CXX_OBJECT(SocketHubAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(SocketHubAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() SocketHubAppender(); ~SocketHubAppender(); /** Connects to remote server at <code>address</code> and <code>port</code>. */ SocketHubAppender(int port) ; /** Set up the socket server on the specified port. */ virtual void activateOptions(); /** Set options */ virtual void setOption(const String& option, const String& value); /** Close this appender. <p>This will mark the appender as closed and call then #cleanUp method. */ virtual void close(); /** Release the underlying ServerMonitor thread, and drop the connections to all connected remote servers. */ void cleanUp(); /** Append an event to all of current connections. */ virtual void append(const spi::LoggingEventPtr& event); /** The SocketHubAppender does not use a layout. Hence, this method returns <code>false</code>. */ virtual bool requiresLayout() const { return false; } /** The <b>Port</b> option takes a positive integer representing the port where the server is waiting for connections. */ inline void setPort(int port) { this->port = port; } /** Returns value of the <b>Port</b> option. */ inline int getPort() const { return port; } /** The <b>LocationInfo</b> option takes a boolean value. If true, the information sent to the remote host will include location information. By default no location information is sent to the server. */ inline void setLocationInfo(bool locationInfo) { this->locationInfo = locationInfo; } /** Returns value of the <b>LocationInfo</b> option. */ inline bool getLocationInfo() const { return locationInfo; } /** Start the ServerMonitor thread. */ private: void startServer(); /** This class is used internally to monitor a ServerSocket and register new connections in a vector passed in the constructor. */ class LOG4CXX_EXPORT ServerMonitor : public helpers::Runnable, public helpers::ObjectImpl { private: int port; std::vector<helpers::SocketOutputStreamPtr> oosList; bool keepRunning; helpers::Thread * monitorThread; public: BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(ServerMonitor) END_LOG4CXX_CAST_MAP() /** Create a thread and start the monitor. */ ServerMonitor(int port, const std::vector<helpers::SocketOutputStreamPtr>& oosList); /** Stops the monitor. This method will not return until the thread has finished executing. */ void stopMonitor(); /** Method that runs, monitoring the ServerSocket and adding connections as they connect to the socket. */ void run(); }; // class ServerMonitor typedef helpers::ObjectPtrT<ServerMonitor> ServerMonitorPtr; ServerMonitorPtr serverMonitor; }; // class SocketHubAppender } // namespace net }; // namespace log4cxx #endif // _LOG4CXX_NET_SOCKET_HUB_APPENDER_H --- NEW FILE: Makefile.am --- netincdir = $(includedir)/log4cxx/net netinc_HEADERS= $(top_srcdir)/include/log4cxx/net/*.h --- NEW FILE: syslogappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NET_SYSLOG_APPENDER_H #define _LOG4CXX_NET_SYSLOG_APPENDER_H #include <log4cxx/appenderskeleton.h> #include <log4cxx/helpers/syslogwriter.h> #ifndef HAVE_SYSLOG #endif namespace log4cxx { namespace net { class SyslogAppender; typedef helpers::ObjectPtrT<SyslogAppender> SyslogAppenderPtr; /** Use SyslogAppender to send log messages to a remote syslog daemon.*/ class LOG4CXX_EXPORT SyslogAppender : public AppenderSkeleton { public: DECLARE_LOG4CXX_OBJECT(SyslogAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(SyslogAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() SyslogAppender(); SyslogAppender(const LayoutPtr& layout, int syslogFacility); SyslogAppender(const LayoutPtr& layout, const String& syslogHost, int syslogFacility); ~SyslogAppender(); /** Release any resources held by this SyslogAppender.*/ void close(); /** Returns the specified syslog facility as a lower-case String, e.g. "kern", "user", etc. */ static String getFacilityString(int syslogFacility); /** Returns the integer value corresponding to the named syslog facility, or -1 if it couldn't be recognized. @param facilityName one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The matching is case-insensitive. */ static int getFacility(const String &facilityName); void append(const spi::LoggingEventPtr& event); /** This method returns immediately as options are activated when they are set. */ void activateOptions(); void setOption(const String& option, const String& value); /** The SyslogAppender requires a layout. Hence, this method returns <code>true</code>. */ virtual bool requiresLayout() const { return true; } /** The <b>SyslogHost</b> option is the name of the the syslog host where log output should go. <b>WARNING</b> If the SyslogHost is not set, then this appender will fail. */ void setSyslogHost(const String& syslogHost); /** Returns the value of the <b>SyslogHost</b> option. */ inline const String& getSyslogHost() const { return syslogHost; } /** Set the syslog facility. This is the <b>Facility</b> option. <p>The <code>facilityName</code> parameter must be one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. Case is unimportant. */ void setFacility(const String& facilityName); /** Returns the value of the <b>Facility</b> option. */ inline String getFacility() const { return getFacilityString(syslogFacility); } /** If the <b>FacilityPrinting</b> option is set to true, the printed message will include the facility name of the application. It is <em>false</em> by default. */ inline void setFacilityPrinting(bool facilityPrinting) { this->facilityPrinting = facilityPrinting; } /** Returns the value of the <b>FacilityPrinting</b> option. */ inline bool getFacilityPrinting() const { return facilityPrinting; } protected: void initSyslogFacilityStr(); int syslogFacility; // Have LOG_USER as default String facilityStr; bool facilityPrinting; helpers::SyslogWriter * sw; String syslogHost; }; // class SyslogAppender } // namespace net }; // namespace log4cxx #endif // _LOG4CXX_NET_SYSLOG_APPENDER_H --- NEW FILE: socketnode.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NET_SOCKET_NODE_H #define _LOG4CXX_NET_SOCKET_NODE_H #include <log4cxx/helpers/thread.h> #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/objectimpl.h> namespace log4cxx { namespace helpers { class Socket; typedef ObjectPtrT<Socket> SocketPtr; class SocketInputStream; typedef ObjectPtrT<SocketInputStream> SocketInputStreamPtr; } namespace spi { class LoggerRepository; typedef helpers::ObjectPtrT<LoggerRepository> LoggerRepositoryPtr; } namespace net { class SocketNode; typedef helpers::ObjectPtrT<SocketNode> SocketNodePtr; /** Read {@link spi::LoggingEvent LoggingEvent} objects sent from a remote client using Sockets (TCP). These logging events are logged according to local policy, as if they were generated locally. <p>For example, the socket node might decide to log events to a local file and also resent them to a second socket node. */ class LOG4CXX_EXPORT SocketNode : public virtual helpers::Runnable, public virtual helpers::ObjectImpl { protected: helpers::SocketInputStreamPtr is; spi::LoggerRepositoryPtr hierarchy; public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(SocketNode) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(SocketNode) LOG4CXX_CAST_ENTRY(helpers::Runnable) END_LOG4CXX_CAST_MAP() SocketNode(helpers::SocketPtr& socket, spi::LoggerRepositoryPtr& hierarchy); virtual void run(); }; } // namespace net }; // namespace log4cxx #endif // _LOG4CXX_NET_SOCKET_NODE_H --- NEW FILE: smtpappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NET_SMTP_H #define _LOG4CXX_NET_SMTP_H #include <log4cxx/config.h> #ifdef HAVE_SMTP #include <log4cxx/appenderskeleton.h> #include <log4cxx/helpers/cyclicbuffer.h> #include <log4cxx/spi/triggeringeventevaluator.h> namespace log4cxx { namespace net { class SMTPAppender; typedef helpers::ObjectPtrT<SMTPAppender> SMTPAppenderPtr; /** Send an e-mail when a specific logging event occurs, typically on errors or fatal errors. <p>The number of logging events delivered in this e-mail depend on the value of <b>BufferSize</b> option. The <code>SMTPAppender</code> keeps only the last <code>BufferSize</code> logging events in its cyclic buffer. This keeps memory requirements at a reasonable level while still delivering useful application context. */ class LOG4CXX_EXPORT SMTPAppender : public AppenderSkeleton { private: String to; String from; String subject; String smtpHost; int bufferSize; // 512 bool locationInfo; helpers::CyclicBuffer cb; void * session; String encoding; String charset; protected: spi::TriggeringEventEvaluatorPtr evaluator; public: DECLARE_LOG4CXX_OBJECT(SMTPAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(SMTPAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() /** The default constructor will instantiate the appender with a spi::TriggeringEventEvaluator that will trigger on events with level ERROR or higher.*/ SMTPAppender(); /** Use <code>evaluator</code> passed as parameter as the spi::TriggeringEventEvaluator for this net::SMTPAppender. */ SMTPAppender(spi::TriggeringEventEvaluatorPtr evaluator); ~SMTPAppender(); /** Set options */ virtual void setOption(const String& option, const String& value); /** Activate the specified options, such as the smtp host, the recipient, from, etc. */ virtual void activateOptions(); /** Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent. */ virtual void append(const spi::LoggingEventPtr& event); /** This method determines if there is a sense in attempting to append. <p>It checks whether there is a set output target and also if there is a set layout. If these checks fail, then the boolean value <code>false</code> is returned. */ bool checkEntryConditions(); virtual void close(); std::vector<String> parseAddress(const String& addressStr); /** Returns value of the <b>To</b> option. */ inline const String& getTo() const { return to; } /** The <code>SMTPAppender</code> requires a {@link Layout layout}. */ virtual bool requiresLayout() const { return true; } /** Send the contents of the cyclic buffer as an e-mail message. */ void sendBuffer(); /** Returns value of the <b>Charset</b> option. */ inline const String& getCharset() const { return charset; } /** Returns value of the <b>Encoding</b> option. */ inline const String& getEncoding() const { return encoding; } /** Returns value of the <b>EvaluatorClass</b> option. */ String getEvaluatorClass(); /** Returns value of the <b>From</b> option. */ inline const String& getFrom() const { return from; } /** Returns value of the <b>Subject</b> option. */ inline const String& getSubject() const { return subject; } /** The <b>Charset</b> option takes a string value which should be the charset of the mail (<code>us-ascii</code>, <code>iso8859_1</code>, <code>iso8859_2</code>, <code>iso8859_3</code>). */ inline void setCharset(const String& charset) { this->charset = charset; } /** The <b>Encoding</b> option takes a string value which should be the encoding type of the mail (<code>7bit</code>, <code>8bit</code>, <code>base64</code>, <code>binary</code>, <code>quoted</code>). */ inline void setEncoding(const String& charset) { this->encoding = encoding; } /** The <b>From</b> option takes a string value which should be a e-mail address of the sender. */ inline void setFrom(const String& from) { this->from = from; } /** The <b>Subject</b> option takes a string value which should be a the subject of the e-mail message. */ inline void setSubject(const String& subject) { this->subject = subject; } /** The <b>BufferSize</b> option takes a positive integer representing the maximum number of logging events to collect in a cyclic buffer. When the <code>BufferSize</code> is reached, oldest events are deleted as new events are added to the buffer. By default the size of the cyclic buffer is 512 events. */ void setBufferSize(int bufferSize); /** The <b>SMTPHost</b> option takes a string value which should be a the host name of the SMTP server that will send the e-mail message. */ inline void setSMTPHost(const String& smtpHost) { this->smtpHost = smtpHost; } /** Returns value of the <b>SMTPHost</b> option. */ inline const String& getSMTPHost() const { return smtpHost; } /** The <b>To</b> option takes a string value which should be a comma separated list of e-mail address of the recipients. */ inline void setTo(const String& to) { this->to = to; } /** Returns value of the <b>BufferSize</b> option. */ inline int getBufferSize() const { return bufferSize; } /** The <b>EvaluatorClass</b> option takes a string value representing the name of the class implementing the spi::TriggeringEventEvaluator interface. A corresponding object will be instantiated and assigned as the triggering event evaluator for the SMTPAppender. */ void setEvaluatorClass(const String& value); /** The <b>LocationInfo</b> option takes a boolean value. By default, it is set to false which means there will be no effort to extract the location information related to the event. As a result, the layout that formats the events as they are sent out in an e-mail is likely to place the wrong location information (if present in the format). <p>Location information extraction is comparatively very slow and should be avoided unless performance is not a concern. */ inline void setLocationInfo(bool locationInfo) { this->locationInfo = locationInfo; } /** Returns value of the <b>LocationInfo</b> option. */ inline bool getLocationInfo() const { return locationInfo; } }; // class SMTPAppender class LOG4CXX_EXPORT DefaultEvaluator : public virtual spi::TriggeringEventEvaluator, public virtual helpers::ObjectImpl { public: DECLARE_LOG4CXX_OBJECT(DefaultEvaluator) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(spi::TriggeringEventEvaluator) END_LOG4CXX_CAST_MAP() /** Is this <code>event</code> the e-mail triggering event? <p>This method returns <code>true</code>, if the event level has ERROR level or higher. Otherwise it returns <code>false</code>. */ virtual bool isTriggeringEvent(const spi::LoggingEventPtr& event); }; // class DefaultEvaluator } // namespace net }; // namespace log4cxx #endif // HAVE_SMTP #endif // _LOG4CXX_NET_SMTP_H |
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx Added Files: Makefile.am appender.h appenderskeleton.h asyncappender.h autolink.hpp basicconfigurator.h config.h config_auto.h.in config_msvc.h consoleappender.h dailyrollingfileappender.h defaultcategoryfactory.h fileappender.h hierarchy.h htmllayout.h layout.h level.h logger.h logmanager.h mdc.h ndc.h patternlayout.h propertyconfigurator.h provisionnode.h rollingfileappender.h simplelayout.h ttcclayout.h writerappender.h Log Message: --- NEW FILE: autolink.hpp --- /* Copyright (C) 2006 Ferdinando Ametrano This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email qua...@li... The license is also available online at http://quantlib.org/html/license.html This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ #ifndef log4cxx_autolink_hpp #define log4cxx_autolink_hpp // select toolset: #if (_MSC_VER < 1200) # error "unsupported Microsoft compiler" #elif (_MSC_VER == 1200) # define LOG4CXX_LIB_TOOLSET "vc6" #elif (_MSC_VER == 1300) # define LOG4CXX_LIB_TOOLSET "vc7" #elif (_MSC_VER == 1310) # define LOG4CXX_LIB_TOOLSET "vc71" #elif (_MSC_VER == 1400) # define LOG4CXX_LIB_TOOLSET "vc80" #else # error "unknown Microsoft compiler" #endif /*** libraries to be linked ***/ // select thread opt: #ifdef _MT # define LOG4CXX_LIB_THREAD_OPT "-mt" #else # define LOG4CXX_LIB_THREAD_OPT #endif // select linkage opt: #ifdef _DLL # if defined(_DEBUG) # define LOG4CXX_LIB_RT_OPT "-gd" # else # define LOG4CXX_LIB_RT_OPT # endif #else # if defined(_DEBUG) # define LOG4CXX_LIB_RT_OPT "-sgd" # else # define LOG4CXX_LIB_RT_OPT "-s" # endif #endif #define LOG4CXX_LIB_NAME "log4cxxs-" LOG4CXX_LIB_TOOLSET LOG4CXX_LIB_THREAD_OPT LOG4CXX_LIB_RT_OPT ".lib" #pragma comment(lib, LOG4CXX_LIB_NAME) //#ifdef BOOST_LIB_DIAGNOSTIC # pragma message("Linking to lib file: " LOG4CXX_LIB_NAME) //#endif #endif --- NEW FILE: fileappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_FILE_APPENDER_H #define _LOG4CXX_FILE_APPENDER_H #include <log4cxx/config.h> #include <log4cxx/helpers/tchar.h> #include <log4cxx/writerappender.h> #include <fstream> namespace log4cxx { class FileAppender; typedef helpers::ObjectPtrT<FileAppender> FileAppenderPtr; /** * FileAppender appends log events to a file. * * <p>Support for <code>java.io.Writer</code> and console appending * has been deprecated and then removed. See the replacement * solutions: WriterAppender and ConsoleAppender. */ class LOG4CXX_EXPORT FileAppender : public WriterAppender { protected: /** Append to or truncate the file? The default value for this variable is <code>true</code>, meaning that by default a <code>FileAppender</code> will append to an existing file and not truncate it. <p>This option is meaningful only if the FileAppender opens the file. */ bool fileAppend; /** The name of the log file. */ String fileName; /** Do we do bufferedIO? */ bool bufferedIO; /** How big should the IO buffer be? Default is 8K. */ int bufferSize; #ifdef UNICODE std::wofstream ofs; #else std::ofstream ofs; #endif public: DECLARE_LOG4CXX_OBJECT(FileAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(FileAppender) LOG4CXX_CAST_ENTRY_CHAIN(WriterAppender) END_LOG4CXX_CAST_MAP() /** The default constructor does not do anything. */ FileAppender(); /** Instantiate a <code>FileAppender</code> and open the file designated by <code>filename</code>. The opened filename will become the output destination for this appender. <p>If the <code>append</code> parameter is true, the file will be appended to. Otherwise, the file designated by <code>filename</code> will be truncated before being opened. <p>If the <code>bufferedIO</code> parameter is <code>true</code>, then buffered IO will be used to write to the output file. */ FileAppender(const LayoutPtr& layout, const String& filename, bool append, bool bufferedIO, int bufferSize); /** Instantiate a FileAppender and open the file designated by <code>filename</code>. The opened filename will become the output destination for this appender. <p>If the <code>append</code> parameter is true, the file will be appended to. Otherwise, the file designated by <code>filename</code> will be truncated before being opened. */ FileAppender(const LayoutPtr& layout, const String& filename, bool append); /** Instantiate a FileAppender and open the file designated by <code>filename</code>. The opened filename will become the output destination for this appender. <p>The file will be appended to. */ FileAppender(const LayoutPtr& layout, const String& filename); ~FileAppender(); /** The <b>File</b> property takes a string value which should be the name of the file to append to. <p><b>Note that the special values "System.out" or "System.err" are no longer honored.</b> <p>Note: Actual opening of the file is made when #activateOptions is called, not when the options are set. */ void setFile(const String& file); /** Sets and <i>opens</i> the file where the log output will go. The specified file must be writable. <p>If there was already an opened file, then the previous file is closed first. <p><b>Do not use this method directly. To configure a FileAppender or one of its subclasses, set its properties one by one and then call activateOptions.</b> @param file The path to the log file. @param append If true will append to fileName. Otherwise will truncate fileName. @param bufferedIO Do we do bufferedIO? @param bufferSize How big should the IO buffer be? */ void setFile(const String& file, bool append, bool bufferedIO, int bufferSize); /** Returns the value of the <b>Append</b> option. */ inline bool getAppend() const { return fileAppend; } /** Returns the value of the <b>File</b> option. */ inline const String& getFile() const { return fileName; } /** <p>Sets and <i>opens</i> the file where the log output will go. The specified file must be writable. <p>If there was already an opened file, then the previous file is closed first.*/ void activateOptions(); void setOption(const String& option, const String& value); protected: /** Closes the previously opened file. */ virtual void closeWriter(); /** Closes the previously opened file. */ void closeFile(); public: /** Get the value of the <b>BufferedIO</b> option. <p>BufferedIO will significatnly increase performance on heavily loaded systems. */ inline bool getBufferedIO() const { return bufferedIO; } /** Get the size of the IO buffer. */ inline int getBufferSize() const { return bufferSize; } /** The <b>Append</b> option takes a boolean value. It is set to <code>true</code> by default. If true, then <code>File</code> will be opened in append mode by #setFile (see above). Otherwise, setFile will open <code>File</code> in truncate mode. <p>Note: Actual opening of the file is made when #activateOptions is called, not when the options are set. */ inline void setAppend(bool fileAppend) { this->fileAppend = fileAppend; } /** The <b>BufferedIO</b> option takes a boolean value. It is set to <code>false</code> by default. If true, then <code>File</code> will be opened in buffered mode. BufferedIO will significantly increase performance on heavily loaded systems. */ void setBufferedIO(bool bufferedIO); /** Set the size of the IO buffer. */ void setBufferSize(int bufferSize) { this->bufferSize = bufferSize; } }; // class FileAppender } // namespace log4cxx #endif --- NEW FILE: basicconfigurator.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_BASIC_CONFIGURATOR_H #define _LOG4CXX_BASIC_CONFIGURATOR_H #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/objectimpl.h> #include <log4cxx/config.h> #include <log4cxx/helpers/tchar.h> #include <log4cxx/spi/configurator.h> #include <map> namespace log4cxx { class Appender; typedef helpers::ObjectPtrT<Appender> AppenderPtr; /** Use this class to quickly configure the package. <p>For file based configuration see PropertyConfigurator. For XML based configuration see DOMConfigurator. */ class LOG4CXX_EXPORT BasicConfigurator { protected: BasicConfigurator() {} public: /** Add a ConsoleAppender that uses PatternLayout using the PatternLayout#TTCC_CONVERSION_PATTERN and prints to <code>stdout</code> to the root logger.*/ static void configure(); /** Add <code>appender</code> to the root logger. @param appender The appender to add to the root logger. */ static void configure(const AppenderPtr& appender); /** Reset the default hierarchy to its defaut. It is equivalent to calling <code>Logger::getDefaultHierarchy()->resetConfiguration()</code>. See Hierarchy#resetConfiguration() for more details. */ static void resetConfiguration(); }; // class BasicConfigurator } // namespace log4cxx #endif //_LOG4CXX_BASIC_CONFIGURATOR_H --- NEW FILE: propertyconfigurator.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_PROPERTY_CONFIGURATOR_H #define _LOG4CXX_PROPERTY_CONFIGURATOR_H #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/objectimpl.h> #include <log4cxx/config.h> #include <log4cxx/helpers/tchar.h> #include <log4cxx/spi/configurator.h> #include <map> namespace log4cxx { class Logger; typedef helpers::ObjectPtrT<Logger> LoggerPtr; class Appender; typedef helpers::ObjectPtrT<Appender> AppenderPtr; namespace spi { class LoggerFactory; typedef helpers::ObjectPtrT<LoggerFactory> LoggerFactoryPtr; class LoggerRepository; typedef helpers::ObjectPtrT<LoggerRepository> LoggerRepositoryPtr; } namespace helpers { class Properties; } /** Allows the configuration of log4cxx from an external file. See <b>{@link #doConfigure(const String&, spi::LoggerRepositoryPtr&)}</b> for the expected format. <p>It is sometimes useful to see how log4cxx is reading configuration files. You can enable log4cxx internal logging by defining the <b>log4j.debug</b> variable. <P>At class initialization time class, the file <b>log4j.properties</b> will be searched in the current directory. If the file can be found, then it will be fed to the {@link PropertyConfigurator#configure(const String& configFilename)} method. <p>The <code>PropertyConfigurator</code> does not handle the advanced configuration features supported by the {@link xml::DOMConfigurator DOMConfigurator} such as support for {@link spi::Filter Filters}, custom {@link spi::ErrorHandler ErrorHandlers}, nested appenders such as the {@link AsyncAppender AsyncAppender}, etc. <p>All option <em>values</em> admit variable substitution. The syntax of variable substitution is similar to that of Unix shells. The string between an opening <b>"${"</b> and closing <b>"}"</b> is interpreted as a key. The value of the substituted variable can be defined as a system property or in the configuration file itself. The value of the key is first searched in the system properties, and if not found there, it is then searched in the configuration file being parsed. The corresponding value replaces the ${variableName} sequence. For example, if <code>java.home</code> system property is set to <code>/home/xyz</code>, then every occurrence of the sequence <code>${java.home}</code> will be interpreted as <code>/home/xyz</code>. */ class LOG4CXX_EXPORT PropertyConfigurator : virtual public spi::Configurator, virtual public helpers::ObjectImpl { protected: static String CATEGORY_PREFIX; static String LOGGER_PREFIX; static String FACTORY_PREFIX; static String ADDITIVITY_PREFIX; static String ROOT_CATEGORY_PREFIX; static String ROOT_LOGGER_PREFIX; static String APPENDER_PREFIX; static String RENDERER_PREFIX; static String THRESHOLD_PREFIX; /* Key for specifying the {@link spi::LoggerFactory LoggerFactory}. Currently set to "<code>log4j.loggerFactory</code>". */ static String LOGGER_FACTORY_KEY; static String INTERNAL_ROOT_NAME; /** Used internally to keep track of configured appenders. */ std::map<String, AppenderPtr> registry; spi::LoggerFactoryPtr loggerFactory; public: DECLARE_LOG4CXX_OBJECT(PropertyConfigurator) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(spi::Configurator) END_LOG4CXX_CAST_MAP() PropertyConfigurator(); /** Read configuration from a file. <b>The existing configuration is not cleared nor reset.</b> If you require a different behavior, then call {@link LogManager#resetConfiguration resetConfiguration} method before calling <code>doConfigure</code>. <p>The configuration file consists of statements in the format <code>key=value</code>. The syntax of different configuration elements are discussed below. <h3>Repository-wide threshold</h3> <p>The repository-wide threshold filters logging requests by level regardless of logger. The syntax is: <pre> log4j.threshold=[level] </pre> <p>The level value can consist of the string values OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL or a <em>custom level</em> value. A custom level value can be specified in the form level#classname. By default the repository-wide threshold is set to the lowest possible value, namely the level <code>ALL</code>. </p> <h3>Appender configuration</h3> <p>Appender configuration syntax is: <pre> # For appender named <i>appenderName</i>, set its class. # Note: The appender name can contain dots. log4j.appender.appenderName=fully.qualified.name.of.appender.class # Set appender specific options. log4j.appender.appenderName.option1=value1 ... log4j.appender.appenderName.optionN=valueN </pre> For each named appender you can configure its {@link Layout Layout}. The syntax for configuring an appender's layout is: <pre> log4j.appender.appenderName.layout=fully.qualified.name.of.layout.class log4j.appender.appenderName.layout.option1=value1 .... log4j.appender.appenderName.layout.optionN=valueN </pre> <h3>Configuring loggers</h3> <p>The syntax for configuring the root logger is: <pre> log4j.rootLogger=[level], appenderName, appenderName, ... </pre> <p>This syntax means that an optional <em>level</em> can be supplied followed by appender names separated by commas. <p>The level value can consist of the string values OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL or a <em>custom level</em> value. A custom level value can be specified in the form <code>level#classname</code>. <p>If a level value is specified, then the root level is set to the corresponding level. If no level value is specified, then the root level remains untouched. <p>The root logger can be assigned multiple appenders. <p>Each <i>appenderName</i> (separated by commas) will be added to the root logger. The named appender is defined using the appender syntax defined above. <p>For non-root categories the syntax is almost the same: <pre> log4j.logger.logger_name=[level|INHERITED|NULL], appenderName, appenderName, ... </pre> <p>The meaning of the optional level value is discussed above in relation to the root logger. In addition however, the value INHERITED can be specified meaning that the named logger should inherit its level from the logger hierarchy. <p>If no level value is supplied, then the level of the named logger remains untouched. <p>By default categories inherit their level from the hierarchy. However, if you set the level of a logger and later decide that that logger should inherit its level, then you should specify INHERITED as the value for the level value. NULL is a synonym for INHERITED. <p>Similar to the root logger syntax, each <i>appenderName</i> (separated by commas) will be attached to the named logger. <p>See the <a href="../../../../manual.html#additivity">appender additivity rule</a> in the user manual for the meaning of the <code>additivity</code> flag. <h3>Logger Factories</h3> The usage of custom logger factories is discouraged and no longer documented. <h3>Example</h3> <p>An example configuration is given below. Other configuration file examples are given in the <code>examples</code> folder. <pre> # Set options for appender named "A1". # Appender "A1" will be a SyslogAppender log4j.appender.A1=SyslogAppender # The syslog daemon resides on www.abc.net log4j.appender.A1.SyslogHost=www.abc.net # A1's layout is a PatternLayout, using the conversion pattern # <b>%r %-5p %c{2} %M.%L %x - %m\n</b>. Thus, the log output will # include # the relative time since the start of the application in # milliseconds, followed by the level of the log request, # followed by the two rightmost components of the logger name, # followed by the callers method name, followed by the line number, # the nested disgnostic context and finally the message itself. # Refer to the documentation of PatternLayout for further information # on the syntax of the ConversionPattern key. log4j.appender.A1.layout=PatternLayout log4j.appender.A1.layout.ConversionPattern=%-4r %-5p %c{2} %M.%L %x - %m\n # Set options for appender named "A2" # A2 should be a RollingFileAppender, with maximum file size of 10 MB # using at most one backup file. A2's layout is TTCC, using the # ISO8061 date format with context printing enabled. log4j.appender.A2=RollingFileAppender log4j.appender.A2.MaxFileSize=10MB log4j.appender.A2.MaxBackupIndex=1 log4j.appender.A2.layout=TTCCLayout log4j.appender.A2.layout.ContextPrinting=enabled log4j.appender.A2.layout.DateFormat=ISO8601 # Root logger set to DEBUG using the A2 appender defined above. log4j.rootLogger=DEBUG, A2 # Logger definitions: # The SECURITY logger inherits is level from root. However, it's output # will go to A1 appender defined above. It's additivity is non-cumulative. log4j.logger.SECURITY=INHERIT, A1 log4j.additivity.SECURITY=false # Only warnings or above will be logged for the logger "SECURITY.access". # Output will go to A1. log4j.logger.SECURITY.access=WARN # The logger "class.of.the.day" inherits its level from the # logger hierarchy. Output will go to the appender's of the root # logger, A2 in this case. log4j.logger.class.of.the.day=INHERIT </pre> <p>Refer to the <b>setOption</b> method in each Appender and Layout for class specific options. <p>Use the <code>#</code> or <code>!</code> characters at the beginning of a line for comments. <p> @param configFileName The name of the configuration file where the configuration information is stored. @param hierarchy The hierarchy to operation upon. */ void doConfigure(const String& configFileName, spi::LoggerRepositoryPtr& hierarchy); /** Read configuration options from file <code>configFilename</code>. */ static void configure(const String& configFilename); /** Like {@link #configureAndWatch(const String& configFilename, long delay)} except that the default delay as defined by helpers::FileWatchdog#DEFAULT_DELAY is used. @param configFilename A file in key=value format. */ static void configureAndWatch(const String& configFilename); /** Read the configuration file <code>configFilename</code> if it exists. Moreover, a thread will be created that will periodically check if <code>configFilename</code> has been created or modified. The period is determined by the <code>delay</code> argument. If a change or file creation is detected, then <code>configFilename</code> is read to configure log4j. @param configFilename A file in key=value format. @param delay The delay in milliseconds to wait between each check. */ static void configureAndWatch(const String& configFilename, long delay); /** Read configuration options from <code>properties</code>. See #doConfigure(const string&, spi::LoggerRepositoryPtr&) for the expected format. */ static void configure(helpers::Properties& properties); /** Read configuration options from <code>properties</code>. See #doConfigure(const String&, spi::LoggerRepositoryPtr&) for the expected format. */ void doConfigure(helpers::Properties& properties, spi::LoggerRepositoryPtr& hierarchy); // -------------------------------------------------------------------------- // Internal stuff // -------------------------------------------------------------------------- protected: /** Check the provided <code>Properties</code> object for a #LoggerFactory entry specified by #LOGGER_FACTORY_KEY. If such an entry exists, an attempt is made to create an instance using the default constructor. This instance is used for subsequent Logger creations within this configurator. @see #parseCatsAndRenderers */ void configureLoggerFactory(helpers::Properties& props); void configureRootCategory(helpers::Properties& props, spi::LoggerRepositoryPtr& hierarchy); /** Parse non-root elements, such non-root categories and renderers. */ void parseCatsAndRenderers(helpers::Properties& props, spi::LoggerRepositoryPtr& hierarchy); /** Parse the additivity option for a non-root logger. */ void parseAdditivityForLogger(helpers::Properties& props, LoggerPtr& cat, const String& loggerName); /** This method must work for the root logger as well. */ void parseCategory( helpers::Properties& props, LoggerPtr& logger, const String& optionKey, const String& loggerName, const String& value); AppenderPtr parseAppender( helpers::Properties& props, const String& appenderName); void registryPut(const AppenderPtr& appender); AppenderPtr registryGet(const String& name); }; // class PropertyConfigurator } // namespace log4cxx #endif //_LOG4CXX_PROPERTY_CONFIGURATOR_H --- NEW FILE: defaultcategoryfactory.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_DEFAULT_CATEGORY_FACTORY_H #define _LOG4CXX_DEFAULT_CATEGORY_FACTORY_H #include <log4cxx/spi/loggerfactory.h> #include <log4cxx/helpers/objectimpl.h> namespace log4cxx { class Logger; typedef helpers::ObjectPtrT<Logger> LoggerPtr; class LOG4CXX_EXPORT DefaultCategoryFactory : public virtual spi::LoggerFactory, public virtual helpers::ObjectImpl { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(DefaultCategoryFactory) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(spi::LoggerFactory) END_LOG4CXX_CAST_MAP() virtual LoggerPtr makeNewLoggerInstance(const String& name); }; } // namespace log4cxx #endif //_LOG4CXX_DEFAULT_CATEGORY_FACTORY_H --- NEW FILE: config_msvc.h --- /* Name of package */ #define PACKAGE "log4cxx" /* Version number of package */ #define VERSION "0.9.6" /* Define to 1 if you have the `ftime' function. */ #define HAVE_FTIME 1 /* ODBC support through Microsoft ODBC. */ #define HAVE_MS_ODBC 1 /* thread support through Microsoft threads. */ #define HAVE_MS_THREAD 1 /* XML support through Microsoft XML. */ #define HAVE_MS_XML 1 /* ODBC support */ #define HAVE_ODBC 1 /* thread support */ #define HAVE_THREAD 1 /* XML support */ #define HAVE_XML 1 typedef __int64 int64_t; #ifdef WIN32 #pragma warning(disable : 4250 4251 4786 4290) #endif #ifdef LOG4CXX_STATIC #define LOG4CXX_EXPORT // cf. file msvc/static/static.cpp #pragma comment(linker, "/include:?ForceSymbolReferences@@YAXXZ") #else // DLL #ifdef LOG4CXX #define LOG4CXX_EXPORT __declspec(dllexport) #else #define LOG4CXX_EXPORT __declspec(dllimport) #endif #endif #define _WIN32_WINNT 0x0400 --- NEW FILE: appender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_APPENDER_H #define _LOG4CXX_APPENDER_H #include <log4cxx/helpers/tchar.h> #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/object.h> #include <vector> #include <log4cxx/spi/optionhandler.h> namespace log4cxx { // Forward declarations namespace spi { class LoggingEvent; typedef helpers::ObjectPtrT<LoggingEvent> LoggingEventPtr; class Filter; typedef helpers::ObjectPtrT<Filter> FilterPtr; class ErrorHandler; typedef log4cxx::helpers::ObjectPtrT<ErrorHandler> ErrorHandlerPtr; } class Layout; typedef log4cxx::helpers::ObjectPtrT<Layout> LayoutPtr; class Appender; typedef log4cxx::helpers::ObjectPtrT<Appender> AppenderPtr; typedef std::vector<AppenderPtr> AppenderList; /** Implement this interface for your own strategies for outputting log statements. */ class LOG4CXX_EXPORT Appender : public virtual spi::OptionHandler { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(Appender) virtual ~Appender() {} /** Add a filter to the end of the filter list. */ virtual void addFilter(const spi::FilterPtr& newFilter) = 0; /** Returns the head Filter. The Filters are organized in a linked list and so all Filters on this Appender are available through the result. @return the head Filter or null, if no Filters are present */ virtual const spi::FilterPtr& getFilter() const = 0; /** Clear the list of filters by removing all the filters in it. */ virtual void clearFilters() = 0; /** Release any resources allocated within the appender such as file handles, network connections, etc. <p>It is a programming error to append to a closed appender. */ virtual void close() = 0; /** Log in <code>Appender</code> specific way. When appropriate, Loggers will call the <code>doAppend</code> method of appender implementations in order to log. */ virtual void doAppend(const spi::LoggingEventPtr& event) = 0; /** Get the name of this appender. The name uniquely identifies the appender. */ virtual const String& getName() const = 0; /** Set the {@link spi::ErrorHandler ErrorHandler} for this appender. */ virtual void setErrorHandler(const spi::ErrorHandlerPtr& errorHandler) = 0; /** Returns the {@link spi::ErrorHandler ErrorHandler} for this appender. */ virtual const spi::ErrorHandlerPtr& getErrorHandler() const = 0; /** Set the Layout for this appender. */ virtual void setLayout(const LayoutPtr& layout) = 0; /** Returns this appenders layout. */ virtual const LayoutPtr& getLayout() const = 0; /** Set the name of this appender. The name is used by other components to identify this appender. */ virtual void setName(const String& name) = 0; /** Configurators call this method to determine if the appender requires a layout. If this method returns <code>true</code>, meaning that layout is required, then the configurator will configure an layout using the configuration information at its disposal. If this method returns <code>false</code>, meaning that a layout is not required, then layout configuration will be skipped even if there is available layout configuration information at the disposal of the configurator.. <p>In the rather exceptional case, where the appender implementation admits a layout but can also work without it, then the appender should return <code>true</code>. */ virtual bool requiresLayout() const = 0; }; } #endif //_LOG4CXX_APPENDER_H --- NEW FILE: simplelayout.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SIMPLE_LAYOUT_H #define _LOG4CXX_SIMPLE_LAYOUT_H #include <log4cxx/layout.h> namespace log4cxx { class SimpleLayout; typedef helpers::ObjectPtrT<SimpleLayout> SimpleLayoutPtr; /** SimpleLayout consists of the level of the log statement, followed by " - " and then the log message itself. For example, <pre> DEBUG - Hello world </pre> <p> <p>PatternLayout offers a much more powerful alternative. */ class LOG4CXX_EXPORT SimpleLayout : public Layout { public: DECLARE_LOG4CXX_OBJECT(SimpleLayout) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(SimpleLayout) LOG4CXX_CAST_ENTRY_CHAIN(Layout) END_LOG4CXX_CAST_MAP() /** Returns the log statement in a format consisting of the <code>level</code>, followed by " - " and then the <code>message</code>. For example, <pre> INFO - "A message" </pre> <p>The <code>category</code> parameter is ignored. <p> @return A byte array in SimpleLayout format. */ virtual void format(ostream& output, const spi::LoggingEventPtr& event) const; /** The SimpleLayout does not handle the throwable contained within {@link spi::LoggingEvent LoggingEvents}. Thus, it returns <code>true</code>. */ bool ignoresThrowable() const { return true; } virtual void activateOptions() {} virtual void setOption(const String& option, const String& value) {} }; } // namespace log4cxx #endif //_LOG4CXX_SIMPLE_LAYOUT_H --- NEW FILE: logger.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_LOGGER_H #define _LOG4CXX_LOGGER_H #include <log4cxx/config.h> #include <vector> #include <log4cxx/helpers/appenderattachableimpl.h> #include <log4cxx/helpers/objectimpl.h> #include <log4cxx/level.h> #include <log4cxx/spi/loggerfactory.h> #include <log4cxx/spi/loggerrepository.h> #include <log4cxx/helpers/resourcebundle.h> namespace log4cxx { namespace spi { class LoggerFactory; typedef helpers::ObjectPtrT<LoggerFactory> LoggerFactoryPtr; class LoggerRepository; typedef helpers::ObjectPtrT<LoggerRepository> LoggerRepositoryPtr; } class Logger; /** smart pointer to a Logger class */ typedef helpers::ObjectPtrT<Logger> LoggerPtr; /** vector of {@link Logger loggers} */ typedef std::vector<LoggerPtr> LoggerList; /** This is the central class in the log4cxx package. Most logging operations, except configuration, are done through this class. */ class LOG4CXX_EXPORT Logger : public virtual spi::AppenderAttachable, public virtual helpers::ObjectImpl { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(Logger) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(Logger) LOG4CXX_CAST_ENTRY(spi::AppenderAttachable) END_LOG4CXX_CAST_MAP() protected: /** The name of this logger. */ String name; /** The assigned level of this logger. The <code>level</code> variable need not be assigned a value in which case it is inherited form the hierarchy. */ LevelPtr level; /** The parent of this logger. All loggers have at least one ancestor which is the root logger. */ LoggerPtr parent; /** The resourceBundle for localized messages. @see setResourceBundle, getResourceBundle */ helpers::ResourceBundlePtr resourceBundle; /** The fully qualified name of the Category class. See also the getFQCN method. */ static String FQCN; // Loggers need to know what Hierarchy they are in spi::LoggerRepository * repository; helpers::AppenderAttachableImplPtr aai; /** Additivity is set to true by default, that is children inherit the appenders of their ancestors by default. If this variable is set to <code>false</code> then the appenders found in the ancestors of this logger are not used. However, the children of this logger will inherit its appenders, unless the children have their additivity flag set to <code>false</code> too. See the user manual for more details. */ bool additive; protected: friend class DefaultCategoryFactory; /** This constructor created a new <code>logger</code> instance and sets its name. <p>It is intended to be used by sub-classes only. You should not create categories directly. @param name The name of the logger. */ Logger(const String& name); public: ~Logger(); /** Add <code>newAppender</code> to the list of appenders of this Logger instance. <p>If <code>newAppender</code> is already in the list of appenders, then it won't be added again. */ virtual void addAppender(const AppenderPtr& newAppender); /** If <code>assertion</code> parameter is <code>false</code>, then logs <code>msg</code> as an #error statement. @param assertion @param msg The message to print if <code>assertion</code> is false. */ void assertLog(bool assertion, const String& msg); /** Call the appenders in the hierrachy starting at <code>this</code>. If no appenders could be found, emit a warning. <p>This method calls all the appenders inherited from the hierarchy circumventing any evaluation of whether to log or not to log the particular log request. @param event the event to log. */ void callAppenders(const spi::LoggingEventPtr& event); /** Close all attached appenders implementing the AppenderAttachable interface. */ void closeNestedAppenders(); /** Log a message string with the {@link Level#DEBUG DEBUG} level. <p>This method first checks if this logger is <code>DEBUG</code> enabled by comparing the level of this logger with the {@link Level#DEBUG DEBUG} level. If this logger is <code>DEBUG</code> enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag. @param message the message string to log. @param file the file where the log statement was written. @param line the line where the log statement was written. */ void debug(const String& message, const char* file=0, int line=-1); /** Log a message string with the {@link Level#ERROR ERROR} level. <p>This method first checks if this logger is <code>ERROR</code> enabled by comparing the level of this logger with the {@link Level#ERROR ERROR} level. If this logger is <code>ERROR</code> enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag. @param message the message string to log. @param file the file where the log statement was written. @param line the line where the log statement was written. */ void error(const String& message, const char* file=0, int line=-1); /** Log a message string with the {@link Level#FATAL FATAL} level. <p>This method first checks if this logger is <code>FATAL</code> enabled by comparing the level of this logger with the {@link Level#FATAL FATAL} level. If this logger is <code>FATAL</code> enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag. @param message the message string to log. @param file the file where the log statement was written. @param line the line where the log statement was written. */ void fatal(const String& message, const char* file=0, int line=-1); /** This method creates a new logging event and logs the event without further checks. @param level the level to log. @param message the message string to log. @param file the file where the log statement was written. @param line the line where the log statement was written. */ void forcedLog(const LevelPtr& level, const String& message, const char* file=0, int line=-1); /** This method creates a new logging event and logs the event without further checks. @param fqcn The fully qualified name of the calling logger class. @param level the level to log. @param message the message string to log. @param file the file where the log statement was written. @param line the line where the log statement was written. */ protected: void forcedLog(const String& fqcn, const LevelPtr& level, const String& message, const char* file=0, int line=-1); /** Get the additivity flag for this Logger instance. */ public: bool getAdditivity() const; /** Get the appenders contained in this logger as an AppenderList. If no appenders can be found, then an empty AppenderList is returned. @return AppenderList An collection of the appenders in this logger.*/ AppenderList getAllAppenders() const; /** Look for the appender named as <code>name</code>. <p>Return the appender with that name if in the list. Return <code>NULL</code> otherwise. */ AppenderPtr getAppender(const String& name) const; /** Starting from this logger, search the logger hierarchy for a non-null level and return it. <p>The Logger class is designed so that this method executes as quickly as possible. @throws RuntimeException if all levels are null in the hierarchy */ virtual const LevelPtr& getEffectiveLevel() const; /** Return the the LoggerRepository where this <code>Logger</code> is attached. */ spi::LoggerRepositoryPtr getLoggerRepository() const; /** Return the logger name. */ inline const String& getName() const { return name; } /** Returns the parent of this logger. Note that the parent of a given logger may change during the lifetime of the logger. <p>The root logger will return <code>0</code>. */ const LoggerPtr& getParent() const; /** Returns the assigned Level, if any, for this Logger. @return Level - the assigned Level, can be null. */ const LevelPtr& getLevel() const; /** Retrieve a logger by name. */ static LoggerPtr getLogger(const String& name); /** Retrieve the root logger. */ static LoggerPtr getRootLogger(); /** Like #getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory#makeNewLoggerInstance method of the <code>factory</code> parameter. <p>This method is intended to be used by sub-classes. @param name The name of the logger to retrieve. @param factory A LoggerFactory implementation that will actually create a new Instance. */ static LoggerPtr getLogger(const String& name, spi::LoggerFactoryPtr factory); /** Return the <em>inherited</em> ResourceBundle for this logger. This method walks the hierarchy to find the appropriate resource bundle. It will return the resource bundle attached to the closest ancestor of this logger, much like the way priorities are searched. In case there is no bundle in the hierarchy then <code>NULL</code> is returned. */ helpers::ResourceBundlePtr getResourceBundle() const; protected: /** Returns the string resource coresponding to <code>key</code> in this category's inherited resource bundle. If the resource cannot be found, then an {@link #error error} message will be logged complaining about the missing resource. @see #getResourceBundle. */ String getResourceBundleString(const String& key) const; public: /** Log a message string with the {@link Level#INFO INFO} level. <p>This method first checks if this logger is <code>INFO</code> enabled by comparing the level of this logger with the {@link Level#INFO INFO} level. If this logger is <code>INFO</code> enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag. @param message the message string to log. @param file the file where the log statement was written. @param line the line where the log statement was written. */ void info(const String& message, const char* file=NULL, int line=-1); /** Is the appender passed as parameter attached to this category? */ bool isAttached(const AppenderPtr& appender) const; /** * Check whether this logger is enabled for the <code>DEBUG</code> * Level. * * <p> This function is intended to lessen the computational cost of * disabled log debug statements. * * <p> For some <code>logger</code> Logger object, when you write, * <pre> * logger->debug("debug message"); * </pre> * * <p>You incur the cost constructing the message, concatenation in * this case, regardless of whether the message is logged or not. * * <p>If you are worried about speed, then you should write * <pre> * if(logger->isDebugEnabled()) { * logger->debug("debug message"); * } * </pre> * * <p>This way you will not incur the cost of parameter * construction if debugging is disabled for <code>logger</code>. On * the other hand, if the <code>logger</code> is debug enabled, you * will incur the cost of evaluating whether the logger is debug * enabled twice. Once in <code>isDebugEnabled</code> and once in * the <code>debug</code>. This is an insignificant overhead * since evaluating a logger takes about 1%% of the time it * takes to actually log. * * @return bool - <code>true</code> if this logger is debug * enabled, <code>false</code> otherwise. * */ bool isDebugEnabled() const; /** Check whether this logger is enabled for a given Level passed as parameter. See also #isDebugEnabled. @return bool True if this logger is enabled for <code>level</code>. */ bool isEnabledFor(const LevelPtr& level) const; /** Check whether this logger is enabled for the info Level. See also #isDebugEnabled. @return bool - <code>true</code> if this logger is enabled for level info, <code>false</code> otherwise. */ bool isInfoEnabled() const; /** Check whether this logger is enabled for the warn Level. See also #isDebugEnabled. @return bool - <code>true</code> if this logger is enabled for level warn, <code>false</code> otherwise. */ bool isWarnEnabled() const; /** Check whether this logger is enabled for the error Level. See also #isDebugEnabled. @return bool - <code>true</code> if this logger is enabled for level error, <code>false</code> otherwise. */ bool isErrorEnabled() const; /** Check whether this logger is enabled for the fatal Level. See also #isDebugEnabled. @return bool - <code>true</code> if this logger is enabled for level fatal, <code>false</code> otherwise. */ bool isFatalEnabled() const; /** Log a localized and parameterized message. First, the user supplied <code>key</code> is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied object array <code>params</code>. @param level The level of the logging request. @param key The key to be searched in the #resourceBundle. @param file The source file of the logging request, may be null. @param line The number line of the logging request. @see #setResourceBundle */ void l7dlog(const LevelPtr& level, const String& key, const char* file, int line, ...); /** This is the most generic printing method. It is intended to be invoked by <b>wrapper</b> classes. @param level The level of the logging request. @param message The message of the logging request. @param file The source file of the logging request, may be null. @param line The number line of the logging request. */ void log(const LevelPtr& level, const String& message, const char* file=0, int line=-1); /** Remove all previously added appenders from this logger instance. <p>This is useful when re-reading configuration information. */ void removeAllAppenders(); /** Remove the appender passed as parameter form the list of appenders. */ void removeAppender(const AppenderPtr& appender); /** Remove the appender with the name passed as parameter form the list of appenders. */ void removeAppender(const String& name); /** Set the additivity flag for this Logger instance. */ void setAdditivity(bool additive); protected: friend class Hierarchy; /** Only the Hierarchy class can set the hierarchy of a logger.*/ void setHierarchy(spi::LoggerRepository * repository); public: /** Set the level of this Logger. If you are passing any of <code>Level#DEBUG</code>, <code>Level#INFO</code>, <code>Level#WARN</code>, <code>Level#ERROR</code>, <code>Level#FATAL</code> as a parameter, you need to case them as Level. <p>As in <pre> logger->setLevel(Level::DEBUG); </pre> <p>Null values are admitted. */ virtual void setLevel(const LevelPtr& level); /** Set the resource bundle to be used with localized logging method #l7dlog. */ inline void setResourceBundle(const helpers::ResourceBundlePtr& bundle) { resourceBundle = bundle; } /** Log a message string with the {@link Level#WARN WARN} level. <p>This method first checks if this logger is <code>WARN</code> enabled by comparing the level of this logger with the {@link Level#WARN WARN} level. If this logger is <code>WARN</code> enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag. @param message the message string to log. @param file the file where the log statement was written. @param line the line where the log statement was written. */ void warn(const String& message, const char* file=NULL, int line=-1); }; } /** @addtogroup LoggingMacros Logging macros @{ */ /** Logs a message to a specified logger with a specified level. @param logger the logger to be used. @param level the level to log. @param message the message string to log. */ #define LOG4CXX_LOG(logger, level, message) { \ if (logger->isEnabledFor(level)) {\ ::log4cxx::StringBuffer oss; \ oss << message; \ logger->forcedLog(level, oss.str(), __FILE__, __LINE__); }} /** Logs a message to a specified logger with the DEBUG level. @param logger the logger to be used. @param message the message string to log. */ #define LOG4CXX_DEBUG(logger, message) { \ if (logger->isDebugEnabled()) {\ ::log4cxx::StringBuffer oss; \ oss << message; \ logger->forcedLog(::log4cxx::Level::DEBUG, oss.str(), __FILE__, __LINE__); }} /** Logs a message to a specified logger with the INFO level. @param logger the logger to be used. @param message the message string to log. */ #define LOG4CXX_INFO(logger, message) { \ if (logger->isInfoEnabled()) {\ ::log4cxx::StringBuffer oss; \ oss << message; \ logger->forcedLog(::log4cxx::Level::INFO, oss.str(), __FILE__, __LINE__); }} /** Logs a message to a specified logger with the WARN level. @param logger the logger to be used. @param message the message string to log. */ #define LOG4CXX_WARN(logger, message) { \ if (logger->isWarnEnabled()) {\ ::log4cxx::StringBuffer oss; \ oss << message; \ logger->forcedLog(::log4cxx::Level::WARN, oss.str(), __FILE__, __LINE__); }} /** Logs a message to a specified logger with the ERROR level. @param logger the logger to be used. @param message the message string to log. */ #define LOG4CXX_ERROR(logger, message) { \ if (logger->isErrorEnabled()) {\ ::log4cxx::StringBuffer oss; \ oss << message; \ logger->forcedLog(::log4cxx::Level::ERROR, oss.str(), __FILE__, __LINE__); }} /** Logs a message to a specified logger with the FATAL level. @param logger the logger to be used. @param message the message string to log. */ #define LOG4CXX_FATAL(logger, message) { \ if (logger->isFatalEnabled()) {\ ::log4cxx::StringBuffer oss; \ oss << message; \ logger->forcedLog(::log4cxx::Level::FATAL, oss.str(), __FILE__, __LINE__); }} /** Logs a localized message with no parameter. @param logger the logger to be used. @param level the level to log. @param key the key to be searched in the resourceBundle of the logger. */ #define LOG4CXX_L7DLOG(logger, level, key) { \ if (logger->isEnabledFor(level)) {\ logger->l7dlog(level, key, __FILE__, __LINE__); }} /** Logs a localized message with one parameter. @param logger the logger to be used. @param level the level to log. @param key the key to be searched in the resourceBundle of the logger. @param p1 the unique parameter. Must be of type (TCHAR *). */ #define LOG4CXX_L7DLOG1(logger, level, key, p1) { \ if (logger->isEnabledFor(level)) {\ logger->l7dlog(level, key, __FILE__, __LINE__, p1); }} /** Logs a localized message with two parameters. @param logger the logger to be used. @param level the level to log. @param key the key to be searched in the resourceBundle of the logger. @param p1 the first parameter. Must be of type (TCHAR *). @param p2 the second parameter. Must be of type (TCHAR *). */ #define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) { \ if (logger->isEnabledFor(level)) {\ logger->l7dlog(level, key, __FILE__, __LINE__, p1, p2); }} /** Logs a localized message with three parameters. @param logger the logger to be used. @param level the level to log. @param key the key to be searched in the resourceBundle of the logger. @param p1 the first parameter. Must be of type (TCHAR *). @param p2 the second parameter. Must be of type (TCHAR *). @param p3 the third parameter. Must be of type (TCHAR *). */ #define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) { \ if (logger->isEnabledFor(level)) {\ logger->l7dlog(level, key, __FILE__, __LINE__, p1, p2, p3); }} /**@}*/ #endif //_LOG4CXX_LOGGER_H --- NEW FILE: Makefile.am --- SUBDIRS = helpers net nt spi varia xml config db log4cxxincdir = $(includedir)/log4cxx log4cxxinc_HEADERS= $(top_srcdir)/include/log4cxx/*.h* --- NEW FILE: writerappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_WRITER_APPENDER_H #define _LOG4CXX_WRITER_APPENDER_H #include <log4cxx/appenderskeleton.h> namespace log4cxx { class WriterAppender; typedef helpers::ObjectPtrT<WriterAppender> WriterAppenderPtr; /** WriterAppender appends log events to a standard output stream (ostream or wostream) */ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton { protected: /** Immediate flush means that the underlying writer or output stream will be flushed at the end of each append operation. Immediate flush is slower but ensures that each append request is actually written. If <code>immediateFlush</code> is set to <code>false</code>, then there is a good chance that the last few logs events are not actually written to persistent media if and when the application crashes. <p>The <code>immediateFlush</code> variable is set to <code>true</code> by default. */ bool immediateFlush; /** The encoding to use when opening an input stream. <p>The <code>encoding</code> variable is set to <code>""</code> by default which results in the utilization of the system's default encoding. */ String encoding; /** This is the output stream where we will write to.*/ ostream * os; public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(WriterAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(WriterAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() /** This default constructor does nothing.*/ WriterAppender(); /** Instantiate a WriterAppender and set the output destination to <code>os</code>.*/ WriterAppender(const LayoutPtr& layout, ostream * os); ~WriterAppender(); /** If the <b>ImmediateFlush</b> option is set to <code>true</code>, the appender will flush at the end of each write. This is the default behavior. If the option is set to <code>false</code>, then the underlying stream can defer writing to physical medium to a later time. <p>Avoiding the flush operation at the end of each append results in a performance gain of 10 to 20 percent. However, there is safety tradeoff involved in skipping flushing. Indeed, when flushing is skipped, then it is likely that the last few log events will not be recorded on disk when the application exits. This is a high price to pay even for a 20% performance gain. */ void setImmediateFlush(bool value) { immediateFlush = value; } /** Returns value of the <b>ImmediateFlush</b> option. */ bool getImmediateFlush() const { return immediateFlush; } /** This method is called by the AppenderSkeleton#doAppend method. <p>If the output stream exists and is writable then write a log statement to the output stream. Otherwise, write a single warning message to <code>stderr</code>. <p>The format of the output will depend on this appender's layout. */ virtual void append(const spi::LoggingEventPtr& event); protected: /** This method determines if there is a sense in attempting to append. <p>It checks whether there is a set output target and also if there is a set layout. If these checks fail, then the boolean value <code>false</code> is returned. */ virtual bool checkEntryConditions() const; public: /** Close this appender instance. The underlying stream or writer is also closed. <p>Closed appenders cannot be reused. */ virtual void close(); protected: /** * Close the underlying output stream. * */ virtual void closeWriter() = 0; public: const String& getEncoding() const { return encoding; } void setEncoding(const String& value) { encoding = value; } protected: /** Actual writing occurs here. <p>Most subclasses of <code>WriterAppender</code> will need to override this method. */ virtual void subAppend(const spi::LoggingEventPtr& event); /** The WriterAppender requires a layout. Hence, this method returns <code>true</code>. */ public: virtual bool requiresLayout() const { return true; } /** Clear internal references to the writer and other variables. Subclasses can override this method for an alternate closing behavior. */ protected: virtual void reset(); /** Write a footer as produced by the embedded layout's Layout#appendFooter method. */ protected: virtual void writeFooter(); /** Write a header as produced by the embedded layout's Layout#appendHeader me... [truncated message content] |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:47
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx/nt In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx/nt Added Files: EventLogCategories.mc Makefile.am nteventlogappender.h Log Message: --- NEW FILE: nteventlogappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_NT_EVENT_LOG_APPENDER_HEADER_ #define _LOG4CXX_NT_EVENT_LOG_APPENDER_HEADER_ #include <log4cxx/appenderskeleton.h> typedef void * HANDLE; struct HKEY__; struct _SID; typedef struct HKEY__ *HKEY; typedef struct _SID SID; namespace log4cxx { namespace nt { /** * Appends log events to NT EventLog. */ class LOG4CXX_EXPORT NTEventLogAppender : public AppenderSkeleton { public: DECLARE_LOG4CXX_OBJECT(NTEventLogAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(NTEventLogAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() NTEventLogAppender(); NTEventLogAppender(const String& server, const String& log, const String& source, const LayoutPtr& layout); virtual ~NTEventLogAppender(); virtual void activateOptions(); virtual void close(); virtual void setOption(const String& option, const String& value); /** * The SocketAppender does not use a layout. Hence, this method * returns <code>false</code>. * */ bool requiresLayout() const { return true; } void setSource(const String& source) { this->source = source; } const String& getSource() const { return source; } void setLog(const String& log) { this->log = log; } const String& getLog() const { return log; } void setServer(const String& server) { this->server = server; } const String& getServer() const { return server; } protected: virtual void append(const spi::LoggingEventPtr& event); HKEY regGetKey(const String& subkey, unsigned long *disposition); void regSetString(HKEY hkey, const String& name, const String& value); void regSetDword(HKEY hkey, const String& name, unsigned long value); unsigned short getEventType(const spi::LoggingEventPtr& event); unsigned short getEventCategory(const spi::LoggingEventPtr& event); /* * Add this source with appropriate configuration keys to the registry. */ void addRegistryInfo(); // Data String server; String log; String source; HANDLE hEventLog; SID * pCurrentUserSID; }; // class NTEventLogAppender } // namespace nt }; // namespace log4cxx #endif //_LOG4CXX_NT_EVENT_LOG_APPENDER_HEADER_ --- NEW FILE: Makefile.am --- ntincdir = $(includedir)/log4cxx/nt ntinc_HEADERS= $(top_srcdir)/include/log4cxx/nt/*.h --- NEW FILE: EventLogCategories.mc --- MessageId=0x0001 Language=English Fatal . MessageId=0x0002 Language=English Error . MessageId=0x0003 Language=English Warn . MessageId=0x0004 Language=English Info . MessageId=0x0005 Language=English Debug . MessageId=0x1000 Language=English %1 . |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:47
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/tests/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/tests/src Added Files: Makefile.am asyncappendertestcase.cpp drfatestcase.cpp hierarchythresholdtestcase.cpp l7dtestcase.cpp loggertestcase.cpp main.cpp minimumtestcase.cpp patternlayouttest.cpp shortsocketserver.cpp vectorappender.cpp vectorappender.h Log Message: --- NEW FILE: main.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/ui/text/TestRunner.h> #include <stdexcept> #include <iostream> int main( int argc, char **argv) { CppUnit::TextUi::TestRunner runner; CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); runner.addTest(registry.makeTest()); bool wasSuccessful = true; if (argc > 1) { for (int n = 1; n < argc; n++) { try { wasSuccessful = runner.run(argv[n], false) && wasSuccessful; } catch(std::exception& e) { std::cout << e.what() << std::endl; } } } else { bool wasSuccessful = runner.run("", false); } return wasSuccessful ? EXIT_SUCCESS : EXIT_FAILURE; } --- NEW FILE: patternlayouttest.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/mdc.h> #include <log4cxx/patternlayout.h> #include <log4cxx/fileappender.h> #include "util/compare.h" #include "util/transformer.h" #include "util/absolutedateandtimefilter.h" #include "util/iso8601filter.h" #include "util/absolutetimefilter.h" #include "util/relativetimefilter.h" #include "util/controlfilter.h" #include "util/threadfilter.h" #include "util/linenumberfilter.h" #define FILTERED _T("output/filtered") #define TEMP _T("output/temp") #define PAT0 _T("\\[\\d*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message \\d{1,2}") #define PAT1 ISO8601_PAT _T(" ") PAT0 #define PAT2 ABSOLUTE_DATE_AND_TIME_PAT _T(" ") PAT0 #define PAT3 ABSOLUTE_TIME_PAT _T(" ") PAT0 #define PAT4 RELATIVE_TIME_PAT _T(" ") PAT0 #define PAT5 _T("\\[\\d*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* : Message \\d{1,2}") #define PAT6 _T("\\[\\d*]\\ (DEBUG|INFO |WARN |ERROR|FATAL) .*patternlayouttest.cpp\\(\\d{1,4}\\): Message \\d{1,3}") #define PAT11a _T("^(DEBUG|INFO |WARN |ERROR|FATAL) \\[\\d*]\\ log4j.PatternLayoutTest: Message \\d{1,2}") #define PAT11b _T("^(DEBUG|INFO |WARN |ERROR|FATAL) \\[\\d*]\\ root: Message \\d{1,2}") #define PAT12 _T("^\\[\\d*]\\ (DEBUG|INFO |WARN |ERROR|FATAL) ")\ _T(".*patternlayouttest.cpp\\(\\d{1,4}\\): ")\ _T("Message \\d{1,2}") #define PAT_MDC_1 _T("") using namespace log4cxx; class PatternLayoutTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(PatternLayoutTest); CPPUNIT_TEST(test1); CPPUNIT_TEST(test2); CPPUNIT_TEST(test3); CPPUNIT_TEST(test4); CPPUNIT_TEST(test5); CPPUNIT_TEST(test6); CPPUNIT_TEST(test7); CPPUNIT_TEST(test8); CPPUNIT_TEST(test9); CPPUNIT_TEST(test10); CPPUNIT_TEST(test11); CPPUNIT_TEST(test12); CPPUNIT_TEST(testMDC1); CPPUNIT_TEST(testMDC2); CPPUNIT_TEST_SUITE_END(); LoggerPtr root; LoggerPtr logger; public: void setUp() { root = Logger::getRootLogger(); logger = Logger::getLogger(_T("java.org.apache.log4j.PatternLayoutTest")); } void tearDown() { root->getLoggerRepository()->resetConfiguration(); } void test1() { PropertyConfigurator::configure(_T("input/patternLayout1.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/patternLayout.1"))); } void test2() { PropertyConfigurator::configure(_T("input/patternLayout2.properties")); common(); ControlFilter filter1; filter1 << PAT1; ISO8601Filter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.2"))); } void test3() { PropertyConfigurator::configure(_T("input/patternLayout3.properties")); common(); ControlFilter filter1; filter1 << PAT1; ISO8601Filter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.3"))); } // Output format: // 06 avr. 2002 18:30:58,937 [12345] DEBUG atternLayoutTest - Message 0 void test4() { PropertyConfigurator::configure(_T("input/patternLayout4.properties")); common(); ControlFilter filter1; filter1 << PAT2; AbsoluteDateAndTimeFilter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.4"))); } void test5() { PropertyConfigurator::configure(_T("input/patternLayout5.properties")); common(); ControlFilter filter1; filter1 << PAT2; AbsoluteDateAndTimeFilter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.5"))); } void test6() { PropertyConfigurator::configure(_T("input/patternLayout6.properties")); common(); ControlFilter filter1; filter1 << PAT3; AbsoluteTimeFilter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.6"))); } void test7() { PropertyConfigurator::configure(_T("input/patternLayout7.properties")); common(); ControlFilter filter1; filter1 << PAT3; AbsoluteTimeFilter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.7"))); } void test8() { PropertyConfigurator::configure(_T("input/patternLayout8.properties")); common(); ControlFilter filter1; filter1 << PAT4; RelativeTimeFilter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.8"))); } void test9() { PropertyConfigurator::configure(_T("input/patternLayout9.properties")); common(); ControlFilter filter1; filter1 << PAT5; ThreadFilter filter2; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.9"))); } void test10() { PropertyConfigurator::configure(_T("input/patternLayout10.properties")); common(); ControlFilter filter1; filter1 << PAT6; ThreadFilter filter2; LineNumberFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.10"))); } void test11() { PropertyConfigurator::configure(_T("input/patternLayout11.properties")); common(); ControlFilter filter1; filter1 << PAT11a << PAT11b; ThreadFilter filter2; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.11"))); } void test12() { PropertyConfigurator::configure(_T("input/patternLayout12.properties")); common(); ControlFilter filter1; filter1 << PAT12; ThreadFilter filter2; LineNumberFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(TEMP, FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/patternLayout.12"))); } void testMDC1() { PropertyConfigurator::configure(_T("input/patternLayout.mdc.1.properties")); MDC::put(_T("key1"), _T("va11")); MDC::put(_T("key2"), _T("va12")); logger->debug(_T("Hello World")); MDC::clear(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/patternLayout.mdc.1"))); } void testMDC2() { String OUTPUT_FILE = _T("output/patternLayout.mdc.2"); String WITNESS_FILE = _T("witness/patternLayout.mdc.2"); String mdcMsgPattern1 = _T("%m : %X%n"); String mdcMsgPattern2 = _T("%m : %X{key1}%n"); String mdcMsgPattern3 = _T("%m : %X{key2}%n"); String mdcMsgPattern4 = _T("%m : %X{key3}%n"); String mdcMsgPattern5 = _T("%m : %X{key1},%X{key2},%X{key3}%n"); // set up appender PatternLayoutPtr layout = new PatternLayout(_T("%m%n")); AppenderPtr appender = new FileAppender(layout, OUTPUT_FILE, false); // set appender on root and set level to debug root->addAppender(appender); root->setLevel(Level::DEBUG); // output starting message root->debug(_T("starting mdc pattern test")); layout->setConversionPattern(mdcMsgPattern1); layout->activateOptions(); root->debug(_T("empty mdc, no key specified in pattern")); layout->setConversionPattern(mdcMsgPattern2); layout->activateOptions(); root->debug(_T("empty mdc, key1 in pattern")); layout->setConversionPattern(mdcMsgPattern3); layout->activateOptions(); root->debug(_T("empty mdc, key2 in pattern")); layout->setConversionPattern(mdcMsgPattern4); layout->activateOptions(); root->debug(_T("empty mdc, key3 in pattern")); layout->setConversionPattern(mdcMsgPattern5); layout->activateOptions(); root->debug(_T("empty mdc, key1, key2, and key3 in pattern")); MDC::put(_T("key1"), _T("value1")); MDC::put(_T("key2"), _T("value2")); layout->setConversionPattern(mdcMsgPattern1); layout->activateOptions(); root->debug(_T("filled mdc, no key specified in pattern")); layout->setConversionPattern(mdcMsgPattern2); layout->activateOptions(); root->debug(_T("filled mdc, key1 in pattern")); layout->setConversionPattern(mdcMsgPattern3); layout->activateOptions(); root->debug(_T("filled mdc, key2 in pattern")); layout->setConversionPattern(mdcMsgPattern4); layout->activateOptions(); root->debug(_T("filled mdc, key3 in pattern")); layout->setConversionPattern(mdcMsgPattern5); layout->activateOptions(); root->debug(_T("filled mdc, key1, key2, and key3 in pattern")); MDC::remove(_T("key1")); MDC::remove(_T("key2")); layout->setConversionPattern(_T("%m%n")); layout->activateOptions(); root->debug(_T("finished mdc pattern test")); CPPUNIT_ASSERT(Compare::compare(OUTPUT_FILE, WITNESS_FILE)); } void common() { int i = -1; LOG4CXX_DEBUG(logger, _T("Message ") << ++i); LOG4CXX_DEBUG(root, _T("Message ") << i); LOG4CXX_INFO(logger, _T("Message ") << ++i); LOG4CXX_INFO(root, _T("Message ") << i); LOG4CXX_WARN(logger, _T("Message ") << ++i); LOG4CXX_WARN(root, _T("Message ") << i); LOG4CXX_ERROR(logger, _T("Message ") << ++i); LOG4CXX_ERROR(root, _T("Message ") << i); LOG4CXX_FATAL(logger, _T("Message ") << ++i); LOG4CXX_FATAL(root, _T("Message ") << i); } }; CPPUNIT_TEST_SUITE_REGISTRATION(PatternLayoutTest); --- NEW FILE: asyncappendertestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/logmanager.h> #include <log4cxx/simplelayout.h> #include "vectorappender.h" #include <log4cxx/asyncappender.h> using namespace log4cxx; using namespace log4cxx::helpers; /** A superficial but general test of log4j. */ class AsyncAppenderTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(AsyncAppenderTestCase); CPPUNIT_TEST(closeTest); CPPUNIT_TEST(test2); CPPUNIT_TEST(test3); CPPUNIT_TEST_SUITE_END(); public: void setUp() {} void tearDown() { LogManager::shutdown(); } // this test checks whether it is possible to write to a closed AsyncAppender void closeTest() throw(Exception) { LoggerPtr root = Logger::getRootLogger(); LayoutPtr layout = new SimpleLayout(); VectorAppenderPtr vectorAppender = new VectorAppender(); AsyncAppenderPtr asyncAppender = new AsyncAppender(); asyncAppender->setName(_T("async-CloseTest")); asyncAppender->addAppender(vectorAppender); root->addAppender(asyncAppender); root->debug(_T("m1")); asyncAppender->close(); root->debug(_T("m2")); const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector(); CPPUNIT_ASSERT(v.size() == 1); } // this test checks whether appenders embedded within an AsyncAppender are also // closed void test2() { LoggerPtr root = Logger::getRootLogger(); LayoutPtr layout = new SimpleLayout(); VectorAppenderPtr vectorAppender = new VectorAppender(); AsyncAppenderPtr asyncAppender = new AsyncAppender(); asyncAppender->setName(_T("async-test2")); asyncAppender->addAppender(vectorAppender); root->addAppender(asyncAppender); root->debug(_T("m1")); asyncAppender->close(); root->debug(_T("m2")); const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector(); CPPUNIT_ASSERT(v.size() == 1); CPPUNIT_ASSERT(vectorAppender->isClosed()); } // this test checks whether appenders embedded within an AsyncAppender are also // closed void test3() { typedef std::vector<spi::LoggingEventPtr>::size_type size_type; size_type LEN = 200; LoggerPtr root = Logger::getRootLogger(); LayoutPtr layout = new SimpleLayout(); VectorAppenderPtr vectorAppender = new VectorAppender(); AsyncAppenderPtr asyncAppender = new AsyncAppender(); asyncAppender->setName(_T("async-test3")); asyncAppender->addAppender(vectorAppender); root->addAppender(asyncAppender); for (size_type i = 0; i < LEN; i++) { LOG4CXX_DEBUG(root, _T("message") << i); } asyncAppender->close(); root->debug(_T("m2")); const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector(); CPPUNIT_ASSERT(v.size() == LEN); CPPUNIT_ASSERT(vectorAppender->isClosed()); } }; CPPUNIT_TEST_SUITE_REGISTRATION(AsyncAppenderTestCase); --- NEW FILE: minimumtestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/simplelayout.h> #include <log4cxx/ttcclayout.h> #include <log4cxx/fileappender.h> #include <log4cxx/helpers/absolutetimedateformat.h> #include "util/compare.h" #include "util/transformer.h" #include "util/linenumberfilter.h" #include "util/controlfilter.h" #include "util/absolutedateandtimefilter.h" #include "util/threadfilter.h" using namespace log4cxx; using namespace log4cxx::helpers; #define FILTERED _T("output/filtered") #define TTCC_PAT \ ABSOLUTE_DATE_AND_TIME_PAT \ _T(" \\[\\d*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message \\d{1,2}") #define TTCC2_PAT \ ABSOLUTE_DATE_AND_TIME_PAT \ _T(" \\[\\d*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - ") \ _T("Messages should bear numbers 0 through 23\\.") class MinimumTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(MinimumTestCase); CPPUNIT_TEST(simple); CPPUNIT_TEST(ttcc); CPPUNIT_TEST_SUITE_END(); public: void setUp() { root = Logger::getRootLogger(); root->removeAllAppenders(); } void tearDown() { root->getLoggerRepository()->resetConfiguration(); } void simple() { LayoutPtr layout = new SimpleLayout(); AppenderPtr appender = new FileAppender(layout, _T("output/simple"), false); root->addAppender(appender); common(); CPPUNIT_ASSERT(Compare::compare(_T("output/simple"), _T("witness/simple"))); } void ttcc() { LayoutPtr layout = new TTCCLayout(AbsoluteTimeDateFormat::DATE_AND_TIME_DATE_FORMAT); AppenderPtr appender = new FileAppender(layout, _T("output/ttcc"), false); root->addAppender(appender); common(); ControlFilter filter1; filter1 << TTCC_PAT << TTCC2_PAT; AbsoluteDateAndTimeFilter filter2; ThreadFilter filter3; std::vector<Filter *> filters; filters.push_back(&filter1); filters.push_back(&filter2); filters.push_back(&filter3); try { Transformer::transform(_T("output/ttcc"), FILTERED, filters); } catch(UnexpectedFormatException& e) { tcout << _T("UnexpectedFormatException :") << e.getMessage() << std::endl; throw; } CPPUNIT_ASSERT(Compare::compare(FILTERED, _T("witness/ttcc"))); } void common() { int i = 0; // In the lines below, the category names are chosen as an aid in // remembering their level values. In general, the category names // have no bearing to level values. LoggerPtr ERR = Logger::getLogger(_T("ERR")); ERR->setLevel(Level::ERROR); LoggerPtr INF = Logger::getLogger(_T("INF")); INF->setLevel(Level::INFO); LoggerPtr INF_ERR = Logger::getLogger(_T("INF.ERR")); INF_ERR->setLevel(Level::ERROR); LoggerPtr DEB = Logger::getLogger(_T("DEB")); DEB->setLevel(Level::DEBUG); // Note: categories with undefined level LoggerPtr INF_UNDEF = Logger::getLogger(_T("INF.UNDEF")); LoggerPtr INF_ERR_UNDEF = Logger::getLogger(_T("INF.ERR.UNDEF")); LoggerPtr UNDEF = Logger::getLogger(_T("UNDEF")); // These should all log.---------------------------- LOG4CXX_FATAL(ERR, _T("Message ") << i); i++; //0 LOG4CXX_ERROR(ERR, _T("Message ") << i); i++; LOG4CXX_FATAL(INF, _T("Message ") << i); i++; // 2 LOG4CXX_ERROR(INF, _T("Message ") << i); i++; LOG4CXX_WARN(INF, _T("Message ") << i); i++; LOG4CXX_INFO(INF, _T("Message ") << i); i++; LOG4CXX_FATAL(INF_UNDEF, _T("Message ") << i); i++; //6 LOG4CXX_ERROR(INF_UNDEF, _T("Message ") << i); i++; LOG4CXX_WARN(INF_UNDEF, _T("Message ") << i); i++; LOG4CXX_INFO(INF_UNDEF, _T("Message ") << i); i++; LOG4CXX_FATAL(INF_ERR, _T("Message ") << i); i++; // 10 LOG4CXX_ERROR(INF_ERR, _T("Message ") << i); i++; LOG4CXX_FATAL(INF_ERR_UNDEF, _T("Message ") << i); i++; LOG4CXX_ERROR(INF_ERR_UNDEF, _T("Message ") << i); i++; LOG4CXX_FATAL(DEB, _T("Message ") << i); i++; //14 LOG4CXX_ERROR(DEB, _T("Message ") << i); i++; LOG4CXX_WARN(DEB, _T("Message ") << i); i++; LOG4CXX_INFO(DEB, _T("Message ") << i); i++; LOG4CXX_DEBUG(DEB, _T("Message ") << i); i++; // defaultLevel=DEBUG LOG4CXX_FATAL(UNDEF, _T("Message ") << i); i++; // 19 LOG4CXX_ERROR(UNDEF, _T("Message ") << i); i++; LOG4CXX_WARN(UNDEF, _T("Message ") << i); i++; LOG4CXX_INFO(UNDEF, _T("Message ") << i); i++; LOG4CXX_DEBUG(UNDEF, _T("Message ") << i); i++; // ------------------------------------------------- // The following should not log LOG4CXX_WARN(ERR, _T("Message ") << i); i++; LOG4CXX_INFO(ERR, _T("Message ") << i); i++; LOG4CXX_DEBUG(ERR, _T("Message ") << i); i++; LOG4CXX_DEBUG(INF, _T("Message ") << i); i++; LOG4CXX_DEBUG(INF_UNDEF, _T("Message ") << i); i++; LOG4CXX_WARN(INF_ERR, _T("Message ") << i); i++; LOG4CXX_INFO(INF_ERR, _T("Message ") << i); i++; LOG4CXX_DEBUG(INF_ERR, _T("Message ") << i); i++; LOG4CXX_WARN(INF_ERR_UNDEF, _T("Message ") << i); i++; LOG4CXX_INFO(INF_ERR_UNDEF, _T("Message ") << i); i++; LOG4CXX_DEBUG(INF_ERR_UNDEF, _T("Message ") << i); i++; // ------------------------------------------------- LOG4CXX_INFO(INF, _T("Messages should bear numbers 0 through 23.")); } LoggerPtr root; LoggerPtr logger; }; CPPUNIT_TEST_SUITE_REGISTRATION(MinimumTestCase); --- NEW FILE: hierarchythresholdtestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/propertyconfigurator.h> #include "util/compare.h" #include "xml/xlevel.h" using namespace log4cxx; /** Test the configuration of the hierarchy-wide threshold. */ class HierarchyThresholdTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(HierarchyThresholdTestCase); CPPUNIT_TEST(test1); CPPUNIT_TEST(test2); CPPUNIT_TEST(test3); CPPUNIT_TEST(test4); CPPUNIT_TEST(test5); CPPUNIT_TEST(test6); CPPUNIT_TEST(test7); CPPUNIT_TEST(test8); CPPUNIT_TEST_SUITE_END(); public: void setUp() { } void tearDown() { logger->getLoggerRepository()->resetConfiguration(); } void test1() { PropertyConfigurator::configure(_T("input/hierarchyThreshold1.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.1"))); } void test2() { PropertyConfigurator::configure(_T("input/hierarchyThreshold2.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.2"))); } void test3() { PropertyConfigurator::configure(_T("input/hierarchyThreshold3.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.3"))); } void test4() { PropertyConfigurator::configure(_T("input/hierarchyThreshold4.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.4"))); } void test5() { PropertyConfigurator::configure(_T("input/hierarchyThreshold5.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.5"))); } void test6() { PropertyConfigurator::configure(_T("input/hierarchyThreshold6.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.6"))); } void test7() { PropertyConfigurator::configure(_T("input/hierarchyThreshold7.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.7"))); } void test8() { PropertyConfigurator::configure(_T("input/hierarchyThreshold8.properties")); common(); CPPUNIT_ASSERT(Compare::compare(TEMP, _T("witness/hierarchyThreshold.8"))); } static void common() { logger->log(XLevel::TRACE, _T("m0")); logger->debug(_T("m1")); logger->info(_T("m2")); logger->warn(_T("m3")); logger->error(_T("m4")); logger->fatal(_T("m5")); } private: static String TEMP; static LoggerPtr logger; }; String HierarchyThresholdTestCase::TEMP = _T("output/temp"); LoggerPtr HierarchyThresholdTestCase::logger = Logger::getLogger(_T("HierarchyThresholdTestCase")); CPPUNIT_TEST_SUITE_REGISTRATION(HierarchyThresholdTestCase); --- NEW FILE: shortsocketserver.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/logger.h> #include <log4cxx/helpers/optionconverter.h> #include <log4cxx/helpers/loglog.h> #include <log4cxx/helpers/serversocket.h> #include <log4cxx/mdc.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/logmanager.h> #include <log4cxx/helpers/inetaddress.h> #include <log4cxx/helpers/socket.h> #include <log4cxx/net/socketnode.h> #include <log4cxx/helpers/thread.h> #include "net/socketservertestcase.h" using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::net; class ShortSocketServer { static LoggerPtr logger; public: static void main(int argc, char **argv) { int totalTests = 0; String prefix; if (argc == 3) { USES_CONVERSION totalTests = OptionConverter::toInt(A2T(argv[1]), totalTests); prefix = A2T(argv[2]); } else { usage(argv[0], "Wrong number of arguments."); } LOGLOG_DEBUG(_T("Listening on port ") << PORT); ServerSocket serverSocket(PORT); MDC::put(_T("hostID"), _T("shortSocketServer")); for (int i = 1; i <= totalTests; i++) { StringBuffer sbuf; sbuf << prefix << i << _T(".properties"); PropertyConfigurator::configure(sbuf.str()); LOGLOG_DEBUG(_T("Waiting to accept a new client.")); SocketPtr socket = serverSocket.accept(); LOGLOG_DEBUG(_T("Connected to client at ") << socket->getInetAddress().toString()); LOGLOG_DEBUG(_T("Starting new socket node.")); SocketNodePtr sn = new SocketNode(socket, LogManager::getLoggerRepository()); ThreadPtr t = new Thread(sn); t->start(); t->join(); } } static void usage(const char * programName, const char * msg) { std::cout << msg << std::endl; std::cout << "Usage: " << programName; std::cout << " totalTests configFilePrefix" << std::endl; exit(1); } }; LoggerPtr ShortSocketServer::logger = Logger::getLogger(_T("org.apache.log4j.net.ShortSocketServer")); int main(int argc, char **argv) { int result = EXIT_SUCCESS; try { ShortSocketServer::main(argc, argv); } catch(Exception&) { result = EXIT_FAILURE; } return result; } --- NEW FILE: vectorappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/appenderskeleton.h> #include <vector> #include <log4cxx/spi/loggingevent.h> namespace log4cxx { class VectorAppender; typedef helpers::ObjectPtrT<VectorAppender> VectorAppenderPtr; /** An appender that appends logging events to a vector. */ class VectorAppender : public AppenderSkeleton { public: DECLARE_LOG4CXX_OBJECT(VectorAppender) std::vector<spi::LoggingEventPtr> vector; /** Does nothing. */ void activateOptions() {} /** This method is called by the AppenderSkeleton#doAppend method. */ void append(const spi::LoggingEventPtr& event); const std::vector<spi::LoggingEventPtr>& getVector() const { return vector; } void close(); bool isClosed() const { return closed; } bool requiresLayout() const { return false; } }; } --- NEW FILE: vectorappender.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "vectorappender.h" #include <log4cxx/helpers/thread.h> using namespace log4cxx; using namespace log4cxx::helpers; IMPLEMENT_LOG4CXX_OBJECT(VectorAppender) void VectorAppender::append(const spi::LoggingEventPtr& event) { try { Thread::sleep(5); } catch (Exception&) { } vector.push_back(event); } void VectorAppender::close() { if (this->closed) { return; } this->closed = true; } --- NEW FILE: Makefile.am --- SUBDIRS = customlogger defaultinit helpers net pattern util varia xml EXTRA_DIST = $(top_srcdir)/tests/src/*.cpp noinst_HEADERS= $(top_srcdir)/tests/src/*.h if TESTS INCLUDES = -I$(top_srcdir)/include noinst_PROGRAMS = testsuite shortsocketserver testsuite_SOURCES = \ asyncappendertestcase.cpp\ drfatestcase.cpp\ hierarchythresholdtestcase.cpp\ l7dtestcase.cpp\ loggertestcase.cpp\ main.cpp\ minimumtestcase.cpp\ patternlayouttest.cpp\ vectorappender.cpp testsuite_LDADD = \ $(top_builddir)/src/liblog4cxx.la testsuite_LDFLAGS = \ -Wl,--whole-archive,customlogger/libcustomlogger.a,--no-whole-archive\ -Wl,--whole-archive,defaultinit/libdefaultinit.a,--no-whole-archive\ -Wl,--whole-archive,helpers/libhelpers.a,--no-whole-archive\ -Wl,--whole-archive,net/libnet.a,--no-whole-archive\ -Wl,--whole-archive,pattern/libpattern.a,--no-whole-archive\ -Wl,--whole-archive,util/libutil.a,--no-whole-archive\ -Wl,--whole-archive,varia/libvaria.a,--no-whole-archive\ -Wl,--whole-archive,xml/libxml.a,--no-whole-archive\ @LIBS_CPPUNIT@ -lboost_regex AM_CPPFLAGS = @CPPFLAGS_CPPUNIT@ testsuite_DEPENDENCIES = \ customlogger/libcustomlogger.a\ defaultinit/libdefaultinit.a\ helpers/libhelpers.a\ net/libnet.a\ pattern/libpattern.a\ util/libutil.a\ varia/libvaria.a\ xml/libxml.a\ $(top_builddir)/src/liblog4cxx.la shortsocketserver_SOURCES = \ shortsocketserver.cpp shortsocketserver_LDADD = \ $(top_builddir)/src/liblog4cxx.la shortsocketserver_LDFLAGS = \ -Wl,--whole-archive,util/libutil.a,--no-whole-archive\ -Wl,--whole-archive,xml/libxml.a,--no-whole-archive\ @LIBS_CPPUNIT@ -lboost_regex shortsocketserver_DEPENDENCIES = \ util/libutil.a\ xml/libxml.a\ $(top_builddir)/src/liblog4cxx.la check: testsuite shortsocketserver endif --- NEW FILE: drfatestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/dailyrollingfileappender.h> #include <time.h> #include <log4cxx/helpers/timezone.h> using namespace log4cxx; using namespace log4cxx::helpers; /** Test the configuration of the hierarchy-wide threshold. */ class DRFATestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(DRFATestCase); CPPUNIT_TEST(testComputeCheckPeriod); CPPUNIT_TEST(testRC1); CPPUNIT_TEST(testRC2); CPPUNIT_TEST_SUITE_END(); public: void setUp() { } void tearDown() { } void testComputeCheckPeriod() { RollingCalendar rc; CPPUNIT_ASSERT_EQUAL(RollingCalendar::TOP_OF_DAY, rc.computeTriggeringPeriod(_T("%Y-%m-%d.log"))); CPPUNIT_ASSERT_EQUAL(RollingCalendar::TOP_OF_MINUTE, rc.computeTriggeringPeriod(_T("%Y-%m-%d %M.log"))); CPPUNIT_ASSERT_EQUAL(RollingCalendar::TOP_OF_HOUR, rc.computeTriggeringPeriod(_T("%Y-%m-%d %H.log"))); CPPUNIT_ASSERT_EQUAL(RollingCalendar::TOP_OF_MONTH, rc.computeTriggeringPeriod(_T("%Y-%m.log"))); CPPUNIT_ASSERT_EQUAL(RollingCalendar::TOP_OF_HOUR, rc.computeTriggeringPeriod(_T("log%Hlog"))); } void testRC1() { RollingCalendar rc; rc.setType(RollingCalendar::TOP_OF_DAY); putenv("TZ="); tzset(); // jan, mar, may, july, aug, oct, dec have 31 days int M31[] = { 0, 2, 4, 6, 7, 9, 11 }; for (int i = 0; i < sizeof(M31)/sizeof(M31[0]); i++) { for (int d = 1; d <= 31; d++) { for (int h = 0; h < 23; h++) { struct tm tm; memset(&tm, 0, sizeof(tm)); tm.tm_year = 80; tm.tm_mon = M31[i]; tm.tm_mday = d; tm.tm_hour = h; tm.tm_min = 10; tm.tm_sec = 10; time_t buff = mktime(&tm); int64_t t = int64_t(buff) * 1000; t += 88; int64_t t1 = rc.getNextCheckMillis(t); time_t n = (time_t)(t1 / 1000); struct tm * nextTime = localtime(&n); if (d == 31) { CPPUNIT_ASSERT_EQUAL((M31[i] + 1) % 12, nextTime->tm_mon); CPPUNIT_ASSERT_EQUAL(1, nextTime->tm_mday); } else { CPPUNIT_ASSERT_EQUAL(M31[i], nextTime->tm_mon); CPPUNIT_ASSERT_EQUAL(d + 1, nextTime->tm_mday); } CPPUNIT_ASSERT_EQUAL(0, nextTime->tm_hour); CPPUNIT_ASSERT_EQUAL(0, nextTime->tm_min); CPPUNIT_ASSERT_EQUAL(0, nextTime->tm_sec); CPPUNIT_ASSERT(0 == (t1 % 1000)); } } } } void testRC2() { RollingCalendar rc; rc.setType(RollingCalendar::TOP_OF_HOUR); TimeZonePtr timeZone = rc.getTimeZone(); putenv("TZ="); tzset(); // jan, mar, may, july, aug, oct, dec have 31 days int M31[] = { 0, 2, 4, 6, 7, 9, 11 }; for (int i = 0; i < sizeof(M31)/sizeof(M31[0]); i++) { for (int d = 1; d <= 31; d++) { for (int h = 0; h < 23; h++) { for (int m = 0; m <= 59; m++) { struct tm tm; memset(&tm, 0, sizeof(tm)); tm.tm_year = 80; tm.tm_mon = M31[i]; tm.tm_mday = d; tm.tm_hour = h; tm.tm_min = m; tm.tm_sec = 12; time_t buff = mktime(&tm); int64_t t = int64_t(buff) * 1000; t += 88; bool dltState0 = timeZone->inDaylightTime(t); t = rc.getNextCheckMillis(t); bool dltState1 = timeZone->inDaylightTime(t); time_t n = (time_t)(t / 1000); struct tm * nextTime = localtime(&n); CPPUNIT_ASSERT(0 == (t % 1000)); CPPUNIT_ASSERT_EQUAL(0, nextTime->tm_sec); CPPUNIT_ASSERT_EQUAL(0, nextTime->tm_min); if (dltState0 == dltState1) { CPPUNIT_ASSERT_EQUAL((tm.tm_hour + 1) % 24, nextTime->tm_hour); } else { // returning to standard time if (dltState0) { CPPUNIT_ASSERT_EQUAL(tm.tm_hour, nextTime->tm_hour); } else { // switching to day light saving time } } if (tm.tm_hour == 23) { CPPUNIT_ASSERT_EQUAL(d % 31 + 1, nextTime->tm_mday); if (d == 31) { CPPUNIT_ASSERT_EQUAL((M31[i] + 1) % 12, nextTime->tm_mon); } else { CPPUNIT_ASSERT_EQUAL(M31[i], nextTime->tm_mon); } } else { CPPUNIT_ASSERT_EQUAL(d, nextTime->tm_mday); CPPUNIT_ASSERT_EQUAL(M31[i], nextTime->tm_mon); } } } } } } }; CPPUNIT_TEST_SUITE_REGISTRATION(DRFATestCase); --- NEW FILE: l7dtestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/helpers/propertyresourcebundle.h> #include "util/compare.h" #include <vector> using namespace log4cxx; using namespace log4cxx::helpers; class L7dTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(L7dTestCase); CPPUNIT_TEST(test1); CPPUNIT_TEST_SUITE_END(); LoggerPtr root; ResourceBundlePtr bundles[3]; public: void setUp() { bundles[0] = ResourceBundle::getBundle(_T("L7D"), Locale(_T("en"), _T("US"))); CPPUNIT_ASSERT(bundles[0] != 0); bundles[1] = ResourceBundle::getBundle(_T("L7D"), Locale(_T("fr"), _T("FR"))); CPPUNIT_ASSERT(bundles[1] != 0); bundles[2] = ResourceBundle::getBundle(_T("L7D"), Locale(_T("fr"), _T("CH"))); CPPUNIT_ASSERT(bundles[2] != 0); root = Logger::getRootLogger(); } void tearDown() { root->getLoggerRepository()->resetConfiguration(); } void test1() { PropertyConfigurator::configure(_T("input/l7d1.properties")); for (int i = 0; i < 3; i++) { root->setResourceBundle(bundles[i]); LOG4CXX_L7DLOG(root, Level::DEBUG, _T("bogus1")); LOG4CXX_L7DLOG(root, Level::INFO, _T("test")); LOG4CXX_L7DLOG(root, Level::WARN, _T("hello_world")); StringBuffer sbuf; sbuf << (i+1); LOG4CXX_L7DLOG2(root, Level::DEBUG, _T("msg1"), sbuf.str().c_str(), _T("log4j")); LOG4CXX_L7DLOG2(root, Level::ERROR, _T("bogusMsg"), sbuf.str().c_str(), _T("log4j")); LOG4CXX_L7DLOG2(root, Level::ERROR, _T("msg1"), sbuf.str().c_str(), _T("log4j")); LOG4CXX_L7DLOG(root, Level::INFO, _T("bogus2")); } CPPUNIT_ASSERT(Compare::compare(_T("output/temp"), _T("witness/l7d.1"))); } }; CPPUNIT_TEST_SUITE_REGISTRATION(L7dTestCase); --- NEW FILE: loggertestcase.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <log4cxx/logger.h> #include <log4cxx/fileappender.h> #include <log4cxx/appenderskeleton.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/logmanager.h> #include <log4cxx/level.h> #include <log4cxx/hierarchy.h> #include <log4cxx/spi/rootcategory.h> #include <log4cxx/helpers/propertyresourcebundle.h> using namespace log4cxx; using namespace log4cxx::spi; using namespace log4cxx::helpers; class CountingAppender; typedef helpers::ObjectPtrT<CountingAppender> CountingAppenderPtr; class CountingAppender : public AppenderSkeleton { public: int counter; CountingAppender() : counter(0) {} void close() {} void append(const spi::LoggingEventPtr& event) { counter++; } bool requiresLayout() const { return true; } }; class LoggerTestCase : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(LoggerTestCase); CPPUNIT_TEST(testAppender1); CPPUNIT_TEST(testAppender2); CPPUNIT_TEST(testAdditivity1); CPPUNIT_TEST(testAdditivity2); CPPUNIT_TEST(testAdditivity3); CPPUNIT_TEST(testDisable1); CPPUNIT_TEST(testRB1); CPPUNIT_TEST(testRB2); CPPUNIT_TEST(testRB3); CPPUNIT_TEST(testExists); CPPUNIT_TEST(testHierarchy1); CPPUNIT_TEST_SUITE_END(); public: void setUp() { rbUS = PropertyResourceBundle::getBundle(_T("L7D"), Locale(_T("en"), _T("US"))); CPPUNIT_ASSERT(rbUS != 0); rbFR = PropertyResourceBundle::getBundle(_T("L7D"), Locale(_T("fr"), _T("FR"))); CPPUNIT_ASSERT(rbFR != 0); rbCH = PropertyResourceBundle::getBundle(_T("L7D"), Locale(_T("fr"), _T("CH"))); CPPUNIT_ASSERT(rbCH != 0); } void tearDown() { BasicConfigurator::resetConfiguration(); a1 = 0; a2 = 0; } /** Add an appender and see if it can be retrieved. */ void testAppender1() { logger = Logger::getLogger(_T("test")); a1 = new FileAppender(); a1->setName(_T("testAppender1")); logger->addAppender(a1); AppenderList list = logger->getAllAppenders(); AppenderPtr aHat = list.front(); CPPUNIT_ASSERT_EQUAL(a1, aHat); } /** Add an appender X, Y, remove X and check if Y is the only remaining appender. */ void testAppender2() { a1 = new FileAppender(); a1->setName(_T("testAppender2.1")); a2 = new FileAppender(); a2->setName(_T("testAppender2.2")); logger = Logger::getLogger(_T("test")); logger->addAppender(a1); logger->addAppender(a2); logger->removeAppender(String(_T("testAppender2.1"))); AppenderList list = logger->getAllAppenders(); AppenderPtr aHat = list.front(); CPPUNIT_ASSERT_EQUAL(a2, aHat); CPPUNIT_ASSERT(list.size() == 1); } /** Test if LoggerPtr a.b inherits its appender from a. */ void testAdditivity1() { LoggerPtr a = Logger::getLogger(_T("a")); LoggerPtr ab = Logger::getLogger(_T("a.b")); CountingAppenderPtr ca = new CountingAppender(); a->addAppender(ca); CPPUNIT_ASSERT_EQUAL(ca->counter, 0); ab->debug(MSG); CPPUNIT_ASSERT_EQUAL(ca->counter, 1); ab->info(MSG); CPPUNIT_ASSERT_EQUAL(ca->counter, 2); ab->warn(MSG); CPPUNIT_ASSERT_EQUAL(ca->counter, 3); ab->error(MSG); CPPUNIT_ASSERT_EQUAL(ca->counter, 4); } /** Test multiple additivity. */ void testAdditivity2() { LoggerPtr a = Logger::getLogger(_T("a")); LoggerPtr ab = Logger::getLogger(_T("a.b")); LoggerPtr abc = Logger::getLogger(_T("a.b.c")); LoggerPtr x = Logger::getLogger(_T("x")); CountingAppenderPtr ca1 = new CountingAppender(); CountingAppenderPtr ca2 = new CountingAppender(); a->addAppender(ca1); abc->addAppender(ca2); CPPUNIT_ASSERT_EQUAL(ca1->counter, 0); CPPUNIT_ASSERT_EQUAL(ca2->counter, 0); ab->debug(MSG); CPPUNIT_ASSERT_EQUAL(ca1->counter, 1); CPPUNIT_ASSERT_EQUAL(ca2->counter, 0); abc->debug(MSG); CPPUNIT_ASSERT_EQUAL(ca1->counter, 2); CPPUNIT_ASSERT_EQUAL(ca2->counter, 1); x->debug(MSG); CPPUNIT_ASSERT_EQUAL(ca1->counter, 2); CPPUNIT_ASSERT_EQUAL(ca2->counter, 1); } /** Test additivity flag. */ void testAdditivity3() { LoggerPtr root = Logger::getRootLogger(); LoggerPtr a = Logger::getLogger(_T("a")); LoggerPtr ab = Logger::getLogger(_T("a.b")); LoggerPtr abc = Logger::getLogger(_T("a.b.c")); LoggerPtr x = Logger::getLogger(_T("x")); CountingAppenderPtr caRoot = new CountingAppender(); CountingAppenderPtr caA = new CountingAppender(); CountingAppenderPtr caABC = new CountingAppender(); root->addAppender(caRoot); a->addAppender(caA); abc->addAppender(caABC); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0); CPPUNIT_ASSERT_EQUAL(caA->counter, 0); CPPUNIT_ASSERT_EQUAL(caABC->counter, 0); ab->setAdditivity(false); a->debug(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1); CPPUNIT_ASSERT_EQUAL(caA->counter, 1); CPPUNIT_ASSERT_EQUAL(caABC->counter, 0); ab->debug(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1); CPPUNIT_ASSERT_EQUAL(caA->counter, 1); CPPUNIT_ASSERT_EQUAL(caABC->counter, 0); abc->debug(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1); CPPUNIT_ASSERT_EQUAL(caA->counter, 1); CPPUNIT_ASSERT_EQUAL(caABC->counter, 1); } void testDisable1() { CountingAppenderPtr caRoot = new CountingAppender(); LoggerPtr root = Logger::getRootLogger(); root->addAppender(caRoot); LoggerRepositoryPtr h = LogManager::getLoggerRepository(); //h.disableDebug(); h->setThreshold(Level::INFO); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0); root->debug(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0); root->info(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1); root->log(Level::WARN, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 2); root->warn(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3); //h.disableInfo(); h->setThreshold(Level::WARN); root->debug(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3); root->info(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3); root->log(Level::WARN, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 4); root->error(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 5); root->log(Level::ERROR, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); //h.disableAll(); h->setThreshold(Level::OFF); root->debug(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->info(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->log(Level::WARN, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->error(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->log(Level::FATAL, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->log(Level::FATAL, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); //h.disable(Level::getFatalLevel()); h->setThreshold(Level::OFF); root->debug(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->info(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->log(Level::WARN, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->error(MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->log(Level::WARN, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); root->log(Level::FATAL, MSG); CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6); } void testRB1() { LoggerPtr root = Logger::getRootLogger(); root->setResourceBundle(rbUS); ResourceBundlePtr t = root->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); LoggerPtr x = Logger::getLogger(_T("x")); LoggerPtr x_y = Logger::getLogger(_T("x.y")); LoggerPtr x_y_z = Logger::getLogger(_T("x.y.z")); t = x->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); t = x_y->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); t = x_y_z->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); } void testRB2() { LoggerPtr root = Logger::getRootLogger(); root->setResourceBundle(rbUS); ResourceBundlePtr t = root->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); LoggerPtr x = Logger::getLogger(_T("x")); LoggerPtr x_y = Logger::getLogger(_T("x.y")); LoggerPtr x_y_z = Logger::getLogger(_T("x.y.z")); x_y->setResourceBundle(rbFR); t = x->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); t = x_y->getResourceBundle(); CPPUNIT_ASSERT(t == rbFR); t = x_y_z->getResourceBundle(); CPPUNIT_ASSERT(t == rbFR); } void testRB3() { LoggerPtr root = Logger::getRootLogger(); root->setResourceBundle(rbUS); ResourceBundlePtr t = root->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); LoggerPtr x = Logger::getLogger(_T("x")); LoggerPtr x_y = Logger::getLogger(_T("x.y")); LoggerPtr x_y_z = Logger::getLogger(_T("x.y.z")); x_y->setResourceBundle(rbFR); x_y_z->setResourceBundle(rbCH); t = x->getResourceBundle(); CPPUNIT_ASSERT(t == rbUS); t = x_y->getResourceBundle(); CPPUNIT_ASSERT(t == rbFR); t = x_y_z->getResourceBundle(); CPPUNIT_ASSERT(t == rbCH); } void testExists() { LoggerPtr a = Logger::getLogger(_T("a")); LoggerPtr a_b = Logger::getLogger(_T("a.b")); LoggerPtr a_b_c = Logger::getLogger(_T("a.b.c")); LoggerPtr t; t = LogManager::exists(_T("xx")); CPPUNIT_ASSERT(t == 0); t = LogManager::exists(_T("a")); CPPUNIT_ASSERT_EQUAL(a, t); t = LogManager::exists(_T("a.b")); CPPUNIT_ASSERT_EQUAL(a_b, t); t = LogManager::exists(_T("a.b.c")); CPPUNIT_ASSERT_EQUAL(a_b_c, t); } void testHierarchy1() { LoggerRepositoryPtr h = new Hierarchy(new RootCategory(Level::ERROR)); LoggerPtr a0 = h->getLogger(_T("a")); CPPUNIT_ASSERT(String(_T("a")) == a0->getName()); CPPUNIT_ASSERT(a0->getLevel() == 0); CPPUNIT_ASSERT(Level::ERROR == a0->getEffectiveLevel()); LoggerPtr a1 = h->getLogger(_T("a")); CPPUNIT_ASSERT_EQUAL(a0, a1); } protected: static String MSG; LoggerPtr logger; AppenderPtr a1; AppenderPtr a2; ResourceBundlePtr rbUS; ResourceBundlePtr rbFR; ResourceBundlePtr rbCH; }; String LoggerTestCase::MSG = _T("M"); CPPUNIT_TEST_SUITE_REGISTRATION(LoggerTestCase); |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:47
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/docs Added Files: Doxyfile Doxyfile.in Makefile.am introduction.dox mainpage.dox Log Message: --- NEW FILE: Doxyfile --- # Doxyfile 1.2.18 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # General configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = log4cxx # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = "Version 0.9.7" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = . # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en # (Japanese with english messages), Korean, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish and Ukrainian. OUTPUT_LANGUAGE = English # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = YES # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these class will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited # members of a class in the documentation of that class as if those members were # ordinary class members. Constructors, destructors and assignment operators of # the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. It is allowed to use relative paths in the argument list. STRIP_FROM_PATH = # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower case letters. If set to YES upper case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are adviced to set this option to NO. CASE_SENSE_NAMES = YES # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = YES # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explict @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # reimplements. INHERIT_DOCS = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consist of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. # For instance some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = \ ../include \ ../src \ ../docs/mainpage.dox \ ../docs/introduction.dox # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp # *.h++ *.idl *.odl FILE_PATTERNS = *.h *.cpp # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories # that are symbolic links (a Unix filesystem feature) are excluded from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command <filter> <input-file>, where <filter> # is the value of the INPUT_FILTER tag, and <input-file> is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 2 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = yes # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output dir. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non empty doxygen will try to run # the html help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the Html help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, # or Internet explorer 4.0+). Note that for large projects the tree generation # can take a very long time. In such cases it is better to disable this feature. # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = YES # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = no # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimised for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assigments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_XML = NO # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. PREDEFINED = HAVE_SMTP HAVE_ODBC HAVE_XML # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse the # parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::addtions related to external references #--------------------------------------------------------------------------- # The TAGFILES tag can be used to specify one or more tagfiles. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or # super classes. Setting the tag to NO turns the diagrams off. Note that this # option is superceded by the HAVE_DOT option below. This is only a fallback. It is # recommended to install and use dot, since it yield more powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = yes # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found on the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermedate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::addtions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO --- NEW FILE: introduction.dox --- /** @page Introduction Short introduction to log4cxx This document is largely inspired of the <a href=http://logging.apache.org/log4j/docs/manual.html>Short introduction to log4j</a> by <i>Ceki Gülcü</i> @section Contents - @ref Abstract - @ref IntroductionIntroduction - @ref LoggersAppendersAndLayouts - @ref LoggerHierarchy - @ref AppendersAndLayouts . - @ref Configuration - @ref DefaultInitializationProcedure - @ref NDC - @ref Performance - @ref Conclusion @section Abstract This document describes the log4cxx API, its unique features and design rationale. Log4cxx is an open source project based on the work of several authors. It allows the developer to control which log statements are output with arbitrary granularity. It is fully configurable at runtime using external configuration files. Best of all, log4cxx has a gentle learning curve. Beware: judging from user feedback, it is also quite addictive. @section IntroductionIntroduction Introduction The log4cxx framework is based on log4j, see http://logging.apache.org/log4j for more information on log4cxx. The package is distributed under the <a href=http://logging.apache.org/log4j/LICENSE.txt>Apache Software License </a>, a fully-fledged open source license certified by the <a href=http://www.opensource.org/> open source</a> initiative. The latest log4cxx version, including full-source code, class files and documentation can be found at http://logging.apache.org/log4cxx . Almost every large application includes its own logging or tracing API. Inserting log statements into code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is usually the case for multithreaded applications and distributed applications at large. Experience indicates that logging was an important component of the development cycle. It offeres several advantages. It provides precise context about a run of the application. Once inserted into the code, the generation of logging output requires no human intervention. Moreover, log output can be saved in persistent medium to be studied at a later time. In addition to its use in the development cycle, a sufficiently rich logging package can also be viewed as an auditing tool. Logging does have its drawbacks. It can slow down an application. If too verbose, it can cause scrolling blindness. To alleviate these concerns, log4cxx is designed to be reliable, fast and extensible. Since logging is rarely the main focus of an application, the log4cxx API strives to be simple to understand and to use. @section LoggersAppendersAndLayouts Loggers, Appenders and Layouts Log4cxx has three main components: loggers, appenders and layouts. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported. @subsection LoggerHierarchy Logger hierarchy The first and foremost advantage of any logging API over plain std::cout resides in its ability to disable certain log statements while allowing others to print unhindered. This capability assumes that the logging space, that is, the space of all possible logging statements, is categorized according to some developer-chosen criteria. Loggers are named entities. Logger names are case-sensitive and they follow the hierarchical naming rule: <table bgcolor="#EEEE99"> <tr> <td> <dl> <dt><b>Named Hierarchy</b> <dd><p>A logger is said to be an <em>ancestor</em> of another logger if its name followed by a dot is a prefix of the <em>descendant</em> logger name. A logger is said to be a <em>parent</em> of a <em>child</em> logger if there are no ancestors between itself and the descendant logger. </dl> </table> For example, the logger named <code>com.foo</code> is a parent of the logger named <code>com.foo.Bar</code>. Similarly, <code>cpp</code> is a parent of <code>cpp.util</code> and an ancestor of <code>cpp.util.Vector</code>. This naming scheme should be familiar to most developers. The root logger resides at the top of the logger hierarchy. It is exceptional in two ways: -# it always exists, -# it cannot be retrieved by name. Invoking the class static log4cxx::Logger::getRootLogger method retrieves it. All other loggers are instantiated and retrieved with the class static log4cxx::Logger::getLogger method. This method takes the name of the desired logger as a parameter.Some of the basic methods in the Logger class are listed below. @code #include <log4cxx/logger.h> class Logger { public: // Creation & retrieval methods: static LoggerPtr getRootLogger(); static LoggerPtr getLogger(const String& name); // printing methods: void debug(const String& message); void info(const String& message); void warn(const String& message); void error(const String& message); void fatal(const String& message); // generic printing method: void log(const LevelPtr& l, const String& message); }; @endcode Loggers may be assigned levels. The set of possible levels, that is {@link log4cxx::Level::DEBUG DEBUG}, {@link log4cxx::Level::INFO INFO}, {@link log4cxx::Level::WARN WARN}, {@link log4cxx::Level::ERROR ERROR} and {@link log4cxx::Level::FATAL FATAL} are defined in the log4cxx::Level class. Although we do not encourage you to do so, you may define your own levels by sub-classing the Level class. A perhaps better approach will be explained later on. If a given logger is not assigned a level, then it inherits one from its closest ancestor with an assigned level. More formally: <table bgcolor="#EEEE99"> <tr> <td> <dl> <dt><b>Level Inheritance</b> <dd><p>The <em>inherited level</em> for a given logger <i>C</i>, is equal to the first non-null level in the logger hierarchy, starting at <i>C</i> and proceeding upwards in the hierarchy towards the <code>root</code> logger. </dl> </table> To ensure that all loggers can eventually inherit a level, the root logger always has an assigned level. Below are four tables with various assigned level values and the resulting inherited levels according to the above rule. <table border="1" > <caption align=bottom>Example 1</caption> <tr><th>Logger<br>name</th><th>Assigned<br>level</th> <th>Inherited<br>level</th></tr> <tr align=left><td>root</td> <td>Proot</td> <td>Proot</td></tr> <tr align=left><td>X </td> <td>none</td> <td>Proot</td></tr> <tr align=left><td>X.Y </td> <td>none</td> <td>Proot</td></tr> <tr align=left><td>X.Y.Z</td> <td>none</td> <td>Proot</td></tr> </table> In example 1 above, only the root logger is assigned a level. This level value, <code>Proot</code>, is inherited by the other loggers <code>X</code>, <code>X.Y</code> and <code>X.Y.Z</code>. <table border="1"> <caption align=bottom>Example 2</caption> <tr><th>Logger<br>name</th><th>Assigned<br>level</th> <th>Inherited<br>level</th></tr> <tr align=left><td>root</td> <td>Proot</td> <td>Proot</td></tr> <tr align=left><td>X </td> <td>Px</td> <td>Px</td></tr> <tr align=left><td>X.Y </td> <td>Pxy</td> <td>Pxy</td></tr> <tr align=left><td>X.Y.Z</td> <td>Pxyz</td> <td>Pxyz</td></tr> </table> In example 2, all loggers have an assigned level value. There is no need for level inheritence. <table border="1"> <caption align=bottom>Example 3</caption> <tr><th>Logger<br>name</th><th>Assigned<br>level</th> <th>Inherited<br>level</th></tr> <tr align=left><td>root</td> <td>Proot</td> <td>Proot</td></tr> <tr align=left><td>X </td> <td>Px</td> <td>Px</td></tr> <tr align=left><td>X.Y </td> <td>none</td> <td>Px</td></tr> <tr align=left><td>X.Y.Z</td> <td>Pxyz</td> <td>Pxyz</td></tr> </table> In example 3, the loggers <code>root</code>, <code>X</code> and <code>X.Y.Z</code> are assigned the levels <code>Proot</code>, <code>Px</code> and <code>Pxyz</code> respectively. The logger <code>X.Y</code> inherits its level value from its parent <code>X</code>. <table border=1> <caption align=bottom>Example 4</caption> <tr><th>Logger<br>name</th><th>Assigned<br>level</th> <th>Inherited<br>level</th></tr> <tr align=left><td>root</td> <td>Proot</td> <td>Proot</td></tr> <tr align=left><td>X </td> <td>Px</td> <td>Px</td></tr> <tr align=left><td>X.Y </td> <td>none</td> <td>Px</td></tr> <tr align=left><td>X.Y.Z</td> <td>none</td> <td>Px</td></tr> </table> In example 4, the loggers <code>root</code> and <code>X</code> and are assigned the levels <code>Proot</code> and <code>Px</code> respectively. The loggers <code>X.Y</code> and <code>X.Y.Z</code> inherits their level value from their nearest parent <code>X</code> having an assigned level.. Logging requests are made by invoking one of the printing methods of a logger instance. These printing methods are {@link log4cxx::Logger::debug debug}, {@link log4cxx::Logger::info info}, {@link log4cxx::Logger::warn warn}, {@link log4cxx::Logger::error error}, {@link log4cxx::Logger::fatal fatal} and {@link log4cxx::Logger::log log}. By definition, the printing method determines the level of a logging request. For example, if <code>c</code> is a logger instance, then the statement <code>c.info("..")</code> is a logging request of level INFO. A logging request is said to be <em>enabled</em> if its level is higher than or equal to the level of its logger. Otherwise, the request is said to be <em>disabled</em>. A logger without an assigned level will inherit one from the hierarchy. This rule is summarized below. <a name="selectionRule"><table bgcolor="#EEEE99"> <tr> <td> <dl> <dt><b>Basic Selection Rule</b> <dd><p>A log request of level <i>p</i> in a logger with (either assigned or inherited, whichever is appropriate) level <i>q</i>, is enabled if <i> p >= q</i>. </dl> </table> This rule is at the heart of log4cxx. It assumes that levels are ordered. For the standard levels, we have DEBUG < INFO < WARN < ERROR < FATAL. Here is an example of this rule. @code // get a logger instance named "com.foo" LoggerPtr logger = Logger::getLogger(_T("com.foo")); // Now set its level. Normally you do not need to set the // level of a logger programmatically. This is usually done // in configuration files. logger->setLevel(Level::INFO); LoggerPtr barlogger = Logger::getLogger(_T("com.foo.Bar")); // This request is enabled, because WARN >= INFO. logger->warn(_T("Low fuel level.")); // This request is disabled, because DEBUG < INFO. logger->debug(_T("Starting search for nearest gas station.")); // The logger instance barlogger, named "com.foo.Bar", // will inherit its level from the logger named // "com.foo" Thus, the following request is enabled // because INFO >= INFO. barlogger->info(_T("Located nearest gas station.")); // This request is disabled, because DEBUG < INFO. barlogger->debug(_T("Exiting gas station search")); @endcode Calling the <code>getLogger</code> method with the same name will always return a reference to the exact same logger object. For example, in @code LoggerPtr x = Logger::getLogger("wombat"); LoggerPtr y = Logger::getLogger("wombat"); @endcode <code>x</code> and <code>y</code> refer to <em>exactly</em> the same logger object. Thus, it is possible to configure a logger and then to retrieve the same instance somewhere else in the code without passing around references. In fundamental contradiction to biological parenthood, where parents always preceed their children, log4cxx loggers can be created and configured in any order. In particular, a "parent" logger will find and link to its descendants even if it is instantiated after them. Configuration of the log4cxx environment is typically done at application initialization. The preferred way is by reading a configuration file. This approach will be discussed shortly. Log4cxx makes it easy to name loggers by <em>software component</em>. This can be accomplished by statically instantiating a logger in each class, with the logger name equal to the fully qualified name of the class. This is a useful and straightforward method of defining loggers. As the log output bears the name of the generating logger, this naming strategy makes it easy to identify the origin of a log message. However, this is only one possible, albeit common, strategy for naming loggers. Log4cxx does not restrict the possible set of loggers. The developer is free to name the loggers as desired. Nevertheless, naming loggers after the class where they are located seems to be the best strategy known so far. @subsection AppendersAndLayouts Appenders and Layouts The ability to selectively enable or disable logging requests based on their logger is only part of the picture. Log4cxx allows logging requests to print to multiple destinations. In log4cxx speak, an output destination is called an <em>appender</em>. Currently, appenders exist for the {@link log4cxx::ConsoleAppender console}, {@link log4cxx::FileAppender files}, GUI components, {@link log4cxx::net::SocketAppender remote socket} servers, {@link log4cxx::nt::NTEventLogAppender NT Event Loggers}, and remote UNIX {@link log4cxx::net::SyslogAppender Syslog} daemons. It is also possible to log {@link log4cxx::AsyncAppender asynchronously}. More than one appender can be attached to a logger. The {@link log4cxx::Logger::addAppender addAppender} method adds an appender to a given logger. <b>Each enabled logging request for a given logger will be forwarded to all the appenders in that logger as well as the appenders higher in the hierarchy.</b> In other words, appenders are inherited additively from the logger hierarchy. For example, if a console appender is added to the root logger, then all enabled logging requests will at least print on the console. If in addition a file appender is added to a logger, say <em>C</em>, then enabled logging requests for <em>C</em> and <em>C</em>'s children will print on a file <em>and</em> on the console. It is possible to override this default behavior so that appender accumulation is no longer additive by {@link log4cxx::Logger::setAdditivity setting the additivity flag} to <code>false</code>. The rules governing appender additivity are summarized below. <a name="additivity"><table bgcolor="#EEEE99"> <tr> <td> <dl> <dt><b>Appender Additivity</b> <dd><p>The output of a log statement of logger <i>C</i> will go to all the appenders in <i>C</i> and its ancestors. This is the meaning of the term "appender additivity". <p>However, if an ancestor of logger <i>C</i>, say <i>P</i>, has the additivity flag set to <code>false</code>, then <i>C</i>'s output will be directed to all the appenders in <i>C</i> and it's ancestors upto and including <i>P</i> but not the appenders in any of the ancestors of <i>P</i>. <p>Loggers have their additivity flag set to <code>true</code> by default. </dl> </table> The table below shows an example: <table align=center border=3 cellpadding=10> <tr rowspan="2"> <th>Logger<br>Name <th>Added<br>Appenders <th>Additivity<br>Flag <th>Output Targets <th>Comment <tr><td>root <td>A1 <td>not applicable <td>A1 <td>The root logger is anonymous but can be accessed with the Logger::getRootLogger() method. There is no default appender attached to root. <tr><td>x <td>A-x1, A-x2 <td>true <td>A1, A-x1, A-x2 <td>Appenders of "x" and root. <tr><td>x.y <td>none <td>true <td>A1, A-x1, A-x2 <td>Appenders of "x" and root. <tr><td>x.y.z <td>A-xyz1 <td>true <td>A1, A-x1, A-x2, A-xyz1 <td>Appenders in "x.y.z", "x" and root. <tr><td>security <td>A-sec <td>false <td>A-sec <td>No appender accumulation since the additivity flag is set to <code>false</code>. <tr><td>security.access <td>none <td> true <td> A-sec <td>Only appenders of "security" because the additivity flag in "security" is set to <code>false</code>. </table> More often than not, users wish to customize not only the output destination but also the output format. This is accomplished by associating a <em>layout</em> with an appender. The layout is responsible for formatting the logging request according to the user's wishes, whereas an appender takes care of sending the formatted output to its destination. The {@link log4cxx::PatternLayout PatternLayout}, part of the standard log4cxx distribution, lets the user specify the output format according to conversion patterns similar to the C language <code>printf</code> function. For example, the PatternLayout with the conversion pattern "\%r [\%t] \%-5p \%c - \%m\%n" will output something akin to: <pre>176 [12345] INFO org.foo.Bar - Located nearest gas station. </pre> The first field is the number of milliseconds elapsed since the start of the program. The second field is the identifier of the thread making the log request. The third field is the level of the log statement. The fourth field is the name of the logger associated with the log request. The text after the '-' is the message of the statement. @section Configuration Inserting log requests into the application code requires a fair amount of planning and effort. Observation shows that approximately 4 percent of code is dedicated to logging. Consequently, even moderately sized applications will have thousands of logging statements embedded within their code. Given their number, it becomes imperative to manage these log statements without the need to modify them manually. The log4cxx environment is fully configurable programmatically. However, it is far more flexible to configure log4cxx using configuration files. Currently, configuration files can be written in XML or in properties (key=value) format. <p>Let us give a taste of how this is done with the help of an imaginary application <code>MyApp</code> that uses log4cxx. @code // file MyApp.cpp #include "com/foo/bar.h"; using namespace com::foo; // include log4cxx header files. #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/helpers/exception.h> using namespace log4cxx; using namespace log4cxx::helpers; // Define a static logger variable so that it references the // Logger instance named "MyApp". LoggerPtr logger = Logger::getLogger(_T("MyApp")); int main(int argc, char **argv) { int result = EXIT_SUCCESS; try { // Set up a simple configuration that logs on the console. BasicConfigurator::configure(); logger->info(_T("Entering application.")); Bar bar; bar.doIt(); logger->info(_T("Exiting application.")); } catch(Exception&) { result = EXIT_FAILURE; } return result; } @endcode <code>MyApp</code> begins by including log4cxx related headers. It then defines a static logger variable with the name <code>MyApp</code> which happens to be the fully qualified name of the class. <code>MyApp</code> uses the <code>Bar</code> class defined in the header file <code>com/foo/bar.h</code> and the source file <code>bar.cpp</code>. @code // file <com/foo/bar.h> #include <log4cxx/logger.h>; namespace com { namespace foo { class Bar { static log4cxx::LoggerPtr logger; public: void doIt(); }; }; }; @endcode @code // file <bar.cpp> #include "com/foo/bar.h" using namespace com::foo; using namespace log4cxx; LoggerPtr Bar::logger = Logger::getLogger(_T("com.foo.bar")); void Bar::doIt() { logger->debug(_T("Did it again!")); } @endcode The invocation of the {@link log4cxx::BasicConfigurator::configure BasicConfigurator::configure} method creates a rather simple log4cxx setup. This method is hardwired to add to the root logger {@link log4cxx::ConsoleAppender ConsoleAppender}. The output will be formatted using a {@link log4cxx::PatternLayout PatternLayout} set to the pattern "\%-4r [\%t] \%-5p \%c \%x - \%m\%n". Note that by default, the root logger is assigned to <code>Level::DEBUG</code>. The output of MyApp is: <pre>0 [12345] INFO MyApp - Entering application. 36 [12345] DEBUG com.foo.Bar - Did it again! 51 [12345] INFO MyApp - Exiting application. </pre> As a side note, let me mention that in log4cxx child loggers link only to their existing ancestors. In particular, the logger named <code>com.foo.Bar</code> is linked directly to the <code>root</code> logger, thereby circumventing the unused <code>com</code> or <code>com.foo</code> loggers. This significantly increases performance and reduces log4cxx's memory footprint. The <code>MyApp</code> class configures log4cxx by invoking <code>BasicConfigurator::configure</code> method. Other classes only need to include the <code><log4cxx/logger.h></code> header file, retrieve the loggers they wish to use, and log away. The previous example always outputs the same log information. Fortunately, it is easy to modify <code>MyApp</code> so that the log output can be controlled at run-time. Here is a slightly modified version. @code // file MyApp2.cpp #include "com/foo/bar.h"; using namespace com::foo; // include log4cxx header files. #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/helpers/exception.h> using namespace log4cxx; using namespace log4cxx::helpers; // Define a static logger variable so that it references the // Logger instance named "MyApp". LoggerPtr logger = Logger::getLogger(_T("MyApp")); int main(int argc, char **argv) { int result = EXIT_SUCCESS; try { if (argc > 1) { // BasicConfigurator replaced with PropertyConfigurator. USES_CONVERSION; String propertyFileName = A2W(argv[1]); PropertyConfigurator::configure(propertyFileName); } else { BasicConfigurator::configure(); } logger->info(_T("Entering application.")); Bar bar bar.doIt(); logger->info(_T("Exiting application.")); } catch(Exception&) { result = EXIT_FAILURE; } return result; } @endcode This version of <code>MyApp</code> instructs <code>PropertyConfigurator</code> to parse a configuration file and se... [truncated message content] |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:47
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx/spi In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx/spi Added Files: Makefile.am appenderattachable.h configurator.h defaultrepositoryselector.h errorhandler.h filter.h hierarchyeventlistener.h loggerfactory.h loggerrepository.h loggingevent.h optionhandler.h repositoryselector.h rootcategory.h triggeringeventevaluator.h Log Message: --- NEW FILE: configurator.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_CONFIGURATOR_H #define _LOG4CXX_SPI_CONFIGURATOR_H #include <log4cxx/helpers/tchar.h> #include <log4cxx/helpers/object.h> #include <log4cxx/helpers/objectptr.h> namespace log4cxx { namespace spi { class LoggerRepository; typedef helpers::ObjectPtrT<LoggerRepository> LoggerRepositoryPtr; class Configurator; typedef helpers::ObjectPtrT<Configurator> ConfiguratorPtr; /** Implemented by classes capable of configuring log4j using a URL. */ class LOG4CXX_EXPORT Configurator : virtual public helpers::Object { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(Configurator) /** Special level value signifying inherited behaviour. The current value of this string constant is <b>inherited</b>. #NuLL is a synonym. */ static String INHERITED /*= "inherited"*/; /** Special level signifying inherited behaviour, same as #INHERITED. The current value of this string constant is <b>null</b>. */ static String NuLL /*= "null"*/; /** Interpret a resource pointed by a URL and set up log4j accordingly. The configuration is done relative to the <code>hierarchy</code> parameter. @param configFileName The file to parse @param repository The hierarchy to operation upon. */ virtual void doConfigure(const String& configFileName, spi::LoggerRepositoryPtr& repository) = 0; }; } } #endif // _LOG4CXX_SPI_CONFIGURATOR_H --- NEW FILE: loggerfactory.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_LOGGERFACTORY_H #define _LOG4CXX_SPI_LOGGERFACTORY_H #include <log4cxx/helpers/object.h> #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/tchar.h> namespace log4cxx { class Logger; typedef helpers::ObjectPtrT<Logger> LoggerPtr; namespace spi { /** Implement this interface to create new instances of Logger or a sub-class of Logger. */ class LOG4CXX_EXPORT LoggerFactory : public virtual helpers::Object { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(LoggerFactory) virtual ~LoggerFactory() {} virtual LoggerPtr makeNewLoggerInstance(const String& name) = 0; }; typedef helpers::ObjectPtrT<LoggerFactory> LoggerFactoryPtr; } // namespace spi }; // namesapce log4cxx #endif //_LOG4CXX_SPI_LOGGERFACTORY_H --- NEW FILE: filter.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_FILTER_H #define _LOG4CXX_SPI_FILTER_H #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/objectimpl.h> #include <log4cxx/spi/optionhandler.h> namespace log4cxx { namespace spi { class Filter; typedef helpers::ObjectPtrT<Filter> FilterPtr; class LoggingEvent; typedef helpers::ObjectPtrT<LoggingEvent> LoggingEventPtr; /** Users should extend this class to implement customized logging event filtering. Note that Logger and AppenderSkeleton, the parent class of all standard appenders, have built-in filtering rules. It is suggested that you first use and understand the built-in rules before rushing to write your own custom filters. <p>This abstract class assumes and also imposes that filters be organized in a linear chain. The {@link #decide decide(LoggingEvent)} method of each filter is called sequentially, in the order of their addition to the chain. <p>The {@link #decide decide(LoggingEvent)} method must return one of the integer constants #DENY, #NEUTRAL or #ACCEPT. <p>If the value #DENY is returned, then the log event is dropped immediately without consulting with the remaining filters. <p>If the value #NEUTRAL is returned, then the next filter in the chain is consulted. If there are no more filters in the chain, then the log event is logged. Thus, in the presence of no filters, the default behaviour is to log all logging events. <p>If the value #ACCEPT is returned, then the log event is logged without consulting the remaining filters. <p>The philosophy of log4cxx filters is largely inspired from the Linux ipchains. <p>Note that filtering is only supported by the {@link xml::DOMConfigurator DOMConfigurator}. */ class LOG4CXX_EXPORT Filter : public virtual OptionHandler, public virtual helpers::ObjectImpl { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(Filter) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(Filter) LOG4CXX_CAST_ENTRY(spi::OptionHandler) END_LOG4CXX_CAST_MAP() /** Points to the next filter in the filter chain. */ FilterPtr next; enum FilterDecision { /** The log event must be dropped immediately without consulting with the remaining filters, if any, in the chain. */ DENY = -1, /** This filter is neutral with respect to the log event. The remaining filters, if any, should be consulted for a final decision. */ NEUTRAL = 0, /** The log event must be logged immediately without consulting with the remaining filters, if any, in the chain. */ ACCEPT = 1 }; /** Usually filters options become active when set. We provide a default do-nothing implementation for convenience. */ void activateOptions() {} void setOption(const String& option, const String& value) {} /** <p>If the decision is <code>DENY</code>, then the event will be dropped. If the decision is <code>NEUTRAL</code>, then the next filter, if any, will be invoked. If the decision is ACCEPT then the event will be logged without consulting with other filters in the chain. @param event The LoggingEvent to decide upon. @return The decision of the filter. */ virtual FilterDecision decide(const LoggingEventPtr& event) const = 0; }; } } #endif //_LOG4CXX_SPI_FILTER_H --- NEW FILE: loggingevent.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_LOGGING_EVENT_H #define _LOG4CXX_SPI_LOGGING_EVENT_H #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/tchar.h> #include <time.h> #include <log4cxx/logger.h> #include <log4cxx/mdc.h> #include <set> namespace log4cxx { class Logger; typedef helpers::ObjectPtrT<Logger> LoggerPtr; class Level; namespace helpers { class SocketOutputStream; typedef helpers::ObjectPtrT<SocketOutputStream> SocketOutputStreamPtr; class SocketInputStream; typedef helpers::ObjectPtrT<SocketInputStream> SocketInputStreamPtr; } namespace spi { class LoggingEvent; /** smart pointer to a LoggingEvent class */ typedef helpers::ObjectPtrT<LoggingEvent> LoggingEventPtr; /** The internal representation of logging events. When an affirmative decision is made to log then a <code>LoggingEvent</code> instance is created. This instance is passed around to the different log4cxx components. <p>This class is of concern to those wishing to extend log4cxx. */ class LOG4CXX_EXPORT LoggingEvent : public virtual helpers::ObjectImpl { public: DECLARE_LOG4CXX_OBJECT(LoggingEvent) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(LoggingEvent) END_LOG4CXX_CAST_MAP() /** For serialization only */ LoggingEvent(); /** Instantiate a LoggingEvent from the supplied parameters. <p>Except #timeStamp all the other fields of <code>LoggingEvent</code> are filled when actually needed. <p> @param fqnOfLoggerClass The fully qualified name of the calling logger class. @param logger The logger of this event. @param level The level of this event. @param message The message of this event. @param file The file where this log statement was written. @param line The line where this log statement was written. */ LoggingEvent(const String& fqnOfLoggerClass, const LoggerPtr& logger, const LevelPtr& level, const String& message, const char* file=0, int line=-1); ~LoggingEvent(); /** Return the #level of this event. */ inline const LevelPtr& getLevel() const { return level; } /** Return the name of the #logger. */ const String& getLoggerName() const; /** Return the #message for this logging event. */ inline const String& getMessage() const { return message; } /** Return the #message for this logging event. */ inline const String& getRenderedMessage() const { return message; } /**Returns the time when the application started, in seconds elapsed since 01.01.1970. */ static int64_t getStartTime() { return startTime; } /** Return the #threadId of this event. */ inline unsigned long getThreadId() const { return threadId; } /** Return the #timeStamp of this event. */ inline int64_t getTimeStamp() const { return timeStamp; } /* Return the file where this log statement was written. */ inline char * getFile() const { return file; } /* Return the line where this log statement was written. */ inline int getLine() const { return line; } /** * This method returns the NDC for this event. It will return the * correct content even if the event was generated in a different * thread or even on a different machine. The NDC#get method * should <em>never</em> be called directly. */ const String& getNDC() const; /** Write this event to a helpers::SocketOutputStream. */ void write(helpers::SocketOutputStreamPtr& os) const; void writeLevel(helpers::SocketOutputStreamPtr& os) const; /** Read this event from a helpers::SocketOutputStream. */ void read(const helpers::SocketInputStreamPtr& is); void readLevel(const helpers::SocketInputStreamPtr& is); /** * Returns the the context corresponding to the <code>key</code> parameter. * If there is a local MDC copy, possibly because we are in a logging * server or running inside AsyncAppender, then we search for the key in * MDC copy, if a value is found it is returned. Otherwise, if the search * in MDC copy returns an empty result, then the current thread's * <code>MDC</code> is used. * * <p> * Note that <em>both</em> the local MDC copy and the current thread's MDC * are searched. * </p> */ String getMDC(const String& key) const; /** * Returns the set of of the key values in the MDC for the event. * The returned set is unmodifiable by the caller. * * @return Set an unmodifiable set of the MDC keys. * @since 1.3 */ std::set<String> getMDCKeySet() const; /** Obtain a copy of this thread's MDC prior to serialization or asynchronous logging. */ void getMDCCopy() const; /** * Return a previously set property. The return value can be null. */ String getProperty(const String& key) const; /** * Returns the set of of the key values in the properties * for the event. The returned set is unmodifiable by the caller. * * @return Set an unmodifiable set of the property keys. */ std::set<String> getPropertyKeySet() const; /** * Set a string property using a key and a string value. since 1.3 */ void setProperty(const String& key, const String& value); public: /** * Fully qualified name of the calling category class. */ String fqnOfCategoryClass; private: /** * The logger of the logging event. This field is not serialized for * performance reasons. * * <p> * It is set by the LoggingEvent constructor or set by a remote * entity after deserialization. **/ LoggerPtr logger; /** level of logging event. */ LevelPtr level; /** The nested diagnostic context (NDC) of logging event. */ String ndc; /** The mapped diagnostic context (MDC) of logging event. */ MDC::Map mdcCopy; /** * A map of String keys and String values. */ std::map<String, String> * properties; /** Have we tried to do an NDC lookup? If we did, there is no need * to do it again. Note that its value is always false when * serialized. Thus, a receiving SocketNode will never use it's own * (incorrect) NDC. See also writeObject method. */ bool ndcLookupRequired; /** * Have we tried to do an MDC lookup? If we did, there is no need to do it * again. Note that its value is always false when serialized. See also * the getMDC and getMDCCopy methods. */ bool mdcCopyLookupRequired; /** The application supplied message of logging event. */ String message; /** The name of thread in which this logging event was generated. */ //const LOG4CPLUS_THREAD_KEY_TYPE thread; /** The number of milliseconds elapsed from 1/1/1970 until logging event was created. */ int64_t timeStamp; /** The is the file where this log statement was written. */ char* file; std::string fileFromStream; /** The is the line where this log statement was written. */ int line; /** The identifier of thread in which this logging event was generated. */ unsigned long threadId; static int64_t startTime; }; } } #endif //_LOG4CXX_SPI_LOGGING_EVENT_H --- NEW FILE: loggerrepository.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_LOG_REPOSITORY_H #define _LOG4CXX_SPI_LOG_REPOSITORY_H #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/object.h> #include <log4cxx/helpers/tchar.h> #include <vector> namespace log4cxx { class Level; typedef helpers::ObjectPtrT<Level> LevelPtr; class Logger; typedef helpers::ObjectPtrT<Logger> LoggerPtr; typedef std::vector<LoggerPtr> LoggerList; class Appender; typedef log4cxx::helpers::ObjectPtrT<Appender> AppenderPtr; namespace spi { class HierarchyEventListener; typedef log4cxx::helpers::ObjectPtrT<HierarchyEventListener> HierarchyEventListenerPtr; class LoggerFactory; typedef helpers::ObjectPtrT<LoggerFactory> LoggerFactoryPtr; class LoggerRepository; typedef helpers::ObjectPtrT<LoggerRepository> LoggerRepositoryPtr; /** A <code>LoggerRepository</code> is used to create and retrieve <code>Loggers</code>. The relation between loggers in a repository depends on the repository but typically loggers are arranged in a named hierarchy. <p>In addition to the creational methods, a <code>LoggerRepository</code> can be queried for existing loggers, can act as a point of registry for events related to loggers. */ class LOG4CXX_EXPORT LoggerRepository : public virtual helpers::Object { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(LoggerRepository) virtual ~LoggerRepository() {} /** Add a {@link spi::HierarchyEventListener HierarchyEventListener} event to the repository. */ virtual void addHierarchyEventListener(const HierarchyEventListenerPtr& listener) = 0; /** Is the repository disabled for a given level? The answer depends on the repository threshold and the <code>level</code> parameter. See also #setThreshold method. */ virtual bool isDisabled(int level) const = 0; /** Set the repository-wide threshold. All logging requests below the threshold are immediately dropped. By default, the threshold is set to <code>Level::ALL</code> which has the lowest possible rank. */ virtual void setThreshold(const LevelPtr& level) = 0; /** Another form of {@link #setThreshold(const LevelPtr&) setThreshold} accepting a string parameter instead of a <code>Level</code>. */ virtual void setThreshold(const String& val) = 0; virtual void emitNoAppenderWarning(const LoggerPtr& logger) = 0; /** Get the repository-wide threshold. See {@link #setThreshold(const LevelPtr&) setThreshold} for an explanation. */ virtual const LevelPtr& getThreshold() const = 0; virtual LoggerPtr getLogger(const String& name) = 0; virtual LoggerPtr getLogger(const String& name, spi::LoggerFactoryPtr factory) = 0; virtual LoggerPtr getRootLogger() const = 0; virtual LoggerPtr exists(const String& name) = 0; virtual void shutdown() = 0; virtual LoggerList getCurrentLoggers() const = 0; virtual void fireAddAppenderEvent(const LoggerPtr& logger, const AppenderPtr& appender) = 0; virtual void resetConfiguration() = 0; }; // class LoggerRepository } // namespace spi }; // namespace log4cxx #endif //_LOG4CXX_SPI_LOG_REPOSITORY_H --- NEW FILE: rootcategory.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_ROOT_CATEGORY_H #define _LOG4CXX_SPI_ROOT_CATEGORY_H #include <log4cxx/logger.h> namespace log4cxx { namespace spi { /** RootCategory sits at the top of the logger hierachy. It is a regular logger except that it provides several guarantees. <p>First, it cannot be assigned a null level. Second, since root logger cannot have a parent, the #getEffectiveLevel method always returns the value of the level field without walking the hierarchy. */ class LOG4CXX_EXPORT RootCategory : public Logger { public: /** The root logger names itself as "root". However, the root logger cannot be retrieved by name. */ RootCategory(const LevelPtr& level); /** Return the assigned level value without walking the category hierarchy. */ virtual const LevelPtr& getEffectiveLevel(); /** Setting a null value to the level of the root category may have catastrophic results. We prevent this here. */ void setLevel(const LevelPtr& level); }; } // namespace spi }; // namespace log4cxx #endif //_LOG4CXX_SPI_ROOT_CATEGORY_H --- NEW FILE: defaultrepositoryselector.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_DEFAULT_REPOSITORY_SELECTOR_H #define _LOG4CXX_SPI_DEFAULT_REPOSITORY_SELECTOR_H #include <log4cxx/spi/repositoryselector.h> #include <log4cxx/helpers/objectimpl.h> #include <log4cxx/spi/loggerrepository.h> namespace log4cxx { namespace spi { class LOG4CXX_EXPORT DefaultRepositorySelector : public virtual RepositorySelector, public virtual helpers::ObjectImpl { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(DefaultRepositorySelector) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(RepositorySelector) END_LOG4CXX_CAST_MAP() DefaultRepositorySelector(const LoggerRepositoryPtr& repository) : repository(repository) { } virtual LoggerRepositoryPtr& getLoggerRepository() { return repository; } private: LoggerRepositoryPtr repository; }; } // namespace spi }; // namespace log4cxx #endif //_LOG4CXX_SPI_DEFAULT_REPOSITORY_SELECTOR_H --- NEW FILE: hierarchyeventlistener.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H #define _LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H #include <log4cxx/helpers/object.h> #include <log4cxx/helpers/objectptr.h> #include <vector> namespace log4cxx { class Logger; typedef helpers::ObjectPtrT<Logger> LoggerPtr; class Appender; typedef helpers::ObjectPtrT<Appender> AppenderPtr; namespace spi { class HierarchyEventListener; typedef log4cxx::helpers::ObjectPtrT<HierarchyEventListener> HierarchyEventListenerPtr; typedef std::vector<HierarchyEventListenerPtr> HierarchyEventListenerList; /** Listen to events occuring within a Hierarchy.*/ class LOG4CXX_EXPORT HierarchyEventListener : public virtual log4cxx::helpers::Object { public: virtual ~HierarchyEventListener() {} virtual void addAppenderEvent(const LoggerPtr& logger, const AppenderPtr& appender) = 0; virtual void removeAppenderEvent(const LoggerPtr& logger, const AppenderPtr& appender) = 0; }; } // namespace spi }; // namespace log4cxx #endif //_LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H --- NEW FILE: repositoryselector.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_REPOSITORY_SELECTOR_H #define _LOG4CXX_SPI_REPOSITORY_SELECTOR_H #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/object.h> namespace log4cxx { namespace spi { class LoggerRepository; typedef helpers::ObjectPtrT<LoggerRepository> LoggerRepositoryPtr; class RepositorySelector; typedef helpers::ObjectPtrT<RepositorySelector> RepositorySelectorPtr; /** The <code>LogManager</code> uses one (and only one) <code>RepositorySelector</code> implementation to select the {@link LoggerRepository LoggerRepository} for a particular application context. <p>It is the responsability of the <code>RepositorySelector</code> implementation to track the application context. log4cxx makes no assumptions about the application context or on its management. <p>See also LogManager. */ class LOG4CXX_EXPORT RepositorySelector : public virtual helpers::Object { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(RepositorySelector) virtual ~RepositorySelector() {} virtual LoggerRepositoryPtr& getLoggerRepository() = 0; }; } //namespace spi }; //namespace log4cxx #endif //_LOG4CXX_SPI_REPOSITORY_SELECTOR_H --- NEW FILE: triggeringeventevaluator.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_TRIGGERING_EVENT_EVALUATOR_H #define _LOG4CXX_SPI_TRIGGERING_EVENT_EVALUATOR_H #include <log4cxx/helpers/object.h> #include <log4cxx/helpers/objectptr.h> namespace log4cxx { namespace spi { class TriggeringEventEvaluator; typedef helpers::ObjectPtrT<TriggeringEventEvaluator> TriggeringEventEvaluatorPtr; class LoggingEvent; typedef helpers::ObjectPtrT<Logger> LoggerPtr; /** Implementions of this interface allow certain appenders to decide when to perform an appender specific action. <p>For example the {@link net::SMTPAppender SMTPAppender} sends an email when the #isTriggeringEvent method returns <code>true</code> and adds the event to an internal buffer when the returned result is <code>false</code>. */ class LOG4CXX_EXPORT TriggeringEventEvaluator : public virtual helpers::Object { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(TriggeringEventEvaluator) /** Is this the triggering event? */ virtual bool isTriggeringEvent(const spi::LoggingEventPtr& event) = 0; }; } } #endif // _LOG4CXX_SPI_TRIGGERING_EVENT_EVALUATOR_H --- NEW FILE: optionhandler.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_OPTION_HANDLER_H #define _LOG4CXX_SPI_OPTION_HANDLER_H #include <log4cxx/helpers/tchar.h> #include <log4cxx/helpers/object.h> #include <log4cxx/helpers/objectptr.h> namespace log4cxx { namespace spi { class OptionHandler; typedef helpers::ObjectPtrT<OptionHandler> OptionHandlerPtr; /** A string based interface to configure package components. */ class LOG4CXX_EXPORT OptionHandler : public virtual helpers::Object { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(OptionHandler) virtual ~OptionHandler() {} /** Activate the options that were previously set with calls to option setters. <p>This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set. <p>For example, the FileAppender has the {@link FileAppender#setFile File} and {@link FileAppender#setAppend Append} options both of which are ambigous until the other is also set. */ virtual void activateOptions() = 0; /** Set <code>option</code> to <code>value</code>. <p>The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when #activateOptions is called. */ virtual void setOption(const String& option, const String& value) = 0; }; // class OptionConverter } // namespace spi }; // namespace log4cxx #endif //_LOG4CXX_SPI_OPTION_HANDLER_H --- NEW FILE: appenderattachable.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_APPENDER_ATTACHABLE_H_ #define _LOG4CXX_SPI_APPENDER_ATTACHABLE_H_ #include <log4cxx/helpers/tchar.h> #include <vector> #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/object.h> #include <log4cxx/appender.h> namespace log4cxx { // Forward Declarations class Appender; typedef helpers::ObjectPtrT<Appender> AppenderPtr; typedef std::vector<AppenderPtr> AppenderList; namespace spi { class AppenderAttachable; typedef helpers::ObjectPtrT<AppenderAttachable> AppenderAttachablePtr; /** * This Interface is for attaching Appenders to objects. */ class LOG4CXX_EXPORT AppenderAttachable : public virtual helpers::Object { public: // Methods DECLARE_ABSTRACT_LOG4CXX_OBJECT(AppenderAttachable) /** * Add an appender. */ virtual void addAppender(const AppenderPtr& newAppender) = 0; /** * Get all previously added appenders as an AppenderList. */ virtual AppenderList getAllAppenders() const = 0; /** * Get an appender by name. */ virtual AppenderPtr getAppender(const String& name) const = 0; /** Returns <code>true</code> if the specified appender is in list of attached attached, <code>false</code> otherwise. */ virtual bool isAttached(const AppenderPtr& appender) const = 0; /** * Remove all previously added appenders. */ virtual void removeAllAppenders() = 0; /** * Remove the appender passed as parameter from the list of appenders. */ virtual void removeAppender(const AppenderPtr& appender) = 0; /** * Remove the appender with the name passed as parameter from the * list of appenders. */ virtual void removeAppender(const String& name) = 0; // Dtor virtual ~AppenderAttachable(){} }; } } #endif //_LOG4CXX_SPI_APPENDER_ATTACHABLE_H_ --- NEW FILE: Makefile.am --- spiincdir = $(includedir)/log4cxx/spi spiinc_HEADERS= $(top_srcdir)/include/log4cxx/spi/*.h --- NEW FILE: errorhandler.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_SPI_ERROR_HANDLER_H #define _LOG4CXX_SPI_ERROR_HANDLER_H #include <log4cxx/spi/optionhandler.h> #include <log4cxx/helpers/objectptr.h> #include <log4cxx/helpers/object.h> #include <log4cxx/helpers/exception.h> namespace log4cxx { class Appender; typedef log4cxx::helpers::ObjectPtrT<Appender> AppenderPtr; class Logger; typedef helpers::ObjectPtrT<Logger> LoggerPtr; namespace spi { class ErrorCode { public: enum { GENERIC_FAILURE = 0, WRITE_FAILURE = 1, FLUSH_FAILURE = 2, CLOSE_FAILURE = 3, FILE_OPEN_FAILURE = 4, MISSING_LAYOUT = 5, ADDRESS_PARSE_FAILURE = 6 }; }; class LoggingEvent; typedef helpers::ObjectPtrT<LoggingEvent> LoggingEventPtr; class ErrorHandler; typedef log4cxx::helpers::ObjectPtrT<ErrorHandler> ErrorHandlerPtr; /** Appenders may delegate their error handling to <code>ErrorHandlers</code>. <p>Error handling is a particularly tedious to get right because by definition errors are hard to predict and to reproduce. <p>Please take the time to contact the author in case you discover that errors are not properly handled. You are most welcome to suggest new error handling policies or criticize existing policies. */ class LOG4CXX_EXPORT ErrorHandler : public virtual OptionHandler { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(ErrorHandler) virtual ~ErrorHandler() {} /** Add a reference to a logger to which the failing appender might be attached to. The failing appender will be searched and replaced only in the loggers you add through this method. @param logger One of the loggers that will be searched for the failing appender in view of replacement. */ virtual void setLogger(const LoggerPtr& logger) = 0; /** Equivalent to the error(const String&, helpers::Exception&, int, spi::LoggingEvent&) with the the event parameteter set to null. */ virtual void error(const String& message, helpers::Exception& e, int errorCode) const = 0; /** This method is normally used to just print the error message passed as a parameter. */ virtual void error(const String& message) const = 0; /** This method is invoked to handle the error. @param message The message assoicated with the error. @param e The Exption that was thrown when the error occured. @param errorCode The error code associated with the error. @param event The logging event that the failing appender is asked to log. */ virtual void error(const String& message, helpers::Exception& e, int errorCode, const LoggingEventPtr& event) const = 0; /** Set the appender for which errors are handled. This method is usually called when the error handler is configured. */ virtual void setAppender(const AppenderPtr& appender) = 0; /** Set the appender to fallback upon in case of failure. */ virtual void setBackupAppender(const AppenderPtr& appender) = 0; }; } //namespace spi }; //namespace log4cxx #endif //_LOG4CXX_SPI_ERROR_HANDLER_H |
Update of /cvsroot/objecthandler/log4cxx-0.9.7/performance/xml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/performance/xml Added Files: Makefile.am logging1.xml logging10.xml logging100.xml logging1000.xml logging101.xml logging102.xml logging103.xml logging104.xml logging105.xml logging106.xml logging107.xml logging11.xml logging12.xml logging13.xml logging2.xml logging200.xml logging201.xml logging202.xml logging203.xml logging204.xml logging205.xml logging206.xml logging207.xml logging220.xml logging221.xml logging222.xml logging223.xml logging224.xml logging225.xml logging226.xml logging227.xml logging3.xml logging300.xml logging301.xml logging302.xml logging303.xml logging304.xml logging305.xml logging306.xml logging307.xml logging4.xml logging5.xml logging6.xml logging7.xml logging8.xml logging9.xml Log Message: --- NEW FILE: logging103.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %c - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="TEMP" /> </root> </log4j:configuration> --- NEW FILE: logging107.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%l - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging302.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="RELATIVE"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: logging102.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="RELATIVE"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging301.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%p - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: logging201.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%p - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging305.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: logging101.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%p - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging4.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="RELATIVE"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging1000.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.net.SocketAppender"> <param name="RemoteHost" value="localhost"/> <param name="Port" value="12345"/> <param name="ReconnectionDelay" value="1000"/> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging224.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="ISO8601"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging106.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{%Y-%m-%d %H:%M:%S,%Q} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging2.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%p - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%p - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging13.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%F.%L - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%F.%L - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging303.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %c - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: logging12.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%l - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%l - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging104.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="ISO8601"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging204.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="ISO8601"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging304.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="ISO8601"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: Makefile.am --- EXTRA_DIST = *.xml --- NEW FILE: logging11.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern="%d{%Y-%m-%d %H:%M:%S,%Q} [%t] %-5p %c %x - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{%Y-%m-%d %H:%M:%S,%Q} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging100.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="test"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.SimpleLayout"> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging306.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{%Y-%m-%d %H:%M:%S,%Q} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: logging8.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%r [%t] %-5p %c - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %c - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging9.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.TTCCLayout log4j.appender.NULL.layout.DateFormat=RELATIVE --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="ISO8601"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging202.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="RELATIVE"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging203.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %c - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging222.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.TTCCLayout"> <param name="DateFormat" value="RELATIVE"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging206.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{%Y-%m-%d %H:%M:%S,%Q} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging226.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{%Y-%m-%d %H:%M:%S,%Q} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging6.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%r [%t] %-5p %.10c %x - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %.10c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging223.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %c - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging3.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%-5p - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging10.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c %x - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging220.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="test"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.SimpleLayout"> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging300.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="test"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.SimpleLayout"> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: logging105.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging227.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%l - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging7.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%r [%t] %-5p %.20c %x - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %.20c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging205.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging200.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="test"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.SimpleLayout"> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging5.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.PatternLayout log4j.appender.NULL.layout.ConversionPattern=%r [%t] %-5p %c{2} %x - %m%n --> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%r [%t] %-5p %c{2} %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging307.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="TEMP" /> </appender> <appender name="TEMP" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%l - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="ASYNC" /> </root> </log4j:configuration> --- NEW FILE: logging225.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} [%t] %-5p %c %x - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging207.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%l - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging1.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- PropertyConfigurator equivalent: log4j.rootCategory=, NULL log4j.category.A0123456789=INFO log4j.appender.NULL=org.apache.log4j.performance.NullAppender log4j.appender.NULL.layout=org.apache.log4j.SimpleLayout --> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="NULL" class="org.apache.log4j.performance.NullAppender"> <layout class="org.apache.log4j.SimpleLayout"/> </appender> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> --- NEW FILE: logging221.xml --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="NULL" class="org.apache.log4j.FileAppender"> <param name="File" value="temp"/> <param name="Append" value="false"/> <param name="ImmediateFlush" value="false"/> <param name="BufferedIO" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%p - %m%n"/> </layout> </appender> <category name="A0123456789"> <priority value ="info" /> </category> <root> <priority value ="debug" /> <appender-ref ref="NULL" /> </root> </log4j:configuration> |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:45
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include Added Files: Makefile.am Log Message: --- NEW FILE: Makefile.am --- SUBDIRS = log4cxx |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:44
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/msvc/examples In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/msvc/examples Added Files: Makefile.am examples.dsw trivial.dsp trivial.vcproj Log Message: --- NEW FILE: trivial.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="trivial" ProjectGUID="{DEB106E9-CECD-417D-B5AC-5006E589AA7F}" SccProjectName="" SccLocalPath=""> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Debug/trivial.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxx.lib" OutputFile="../Bin/Debug/trivial.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\Debug/trivial.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Debug/trivial.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Release/trivial.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" SuppressStartupBanner="TRUE"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile=".\Release/trivial.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" ProgramDatabaseFile=".\Release/trivial.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Release/trivial.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Static Debug|Win32" OutputDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LOG4CXX_STATIC" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="2" PrecompiledHeaderFile=".\Debug/trivial.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalDependencies="log4cxxs.lib Ws2_32.lib" OutputFile="../Bin/Static Debug/trivial.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\Debug/trivial.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool" TypeLibraryName=".\Debug/trivial.tlb" HeaderFileName=""/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1036"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> <File RelativePath="..\..\examples\trivial.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="" BasicRuntimeChecks="3"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" Optimization="2" PreprocessorDefinitions=""/> </FileConfiguration> <FileConfiguration Name="Static Debug|Win32"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="" BasicRuntimeChecks="3"/> </FileConfiguration> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl"> </Filter> <Filter Name="Resource Files" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: trivial.dsp --- # Microsoft Developer Studio Project File - Name="trivial" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=trivial - Win32 Static Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "trivial.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "trivial.mak" CFG="trivial - Win32 Static Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "trivial - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "trivial - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "trivial - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") !MESSAGE "trivial - Win32 Unicode Release" (based on "Win32 (x86) Console Application") !MESSAGE "trivial - Win32 Static Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "trivial - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 log4cxx.lib /nologo /subsystem:console /machine:I386 /out:"../Bin/Release/trivial.exe" !ELSEIF "$(CFG)" == "trivial - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Debug/trivial.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "trivial - Win32 Unicode Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "trivial___Win32_Unicode_Debug" # PROP BASE Intermediate_Dir "trivial___Win32_Unicode_Debug" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Unicode_D" # PROP Intermediate_Dir "Unicode_D" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 ole32.lib log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Debug/trivial.exe" /pdbtype:sept # ADD LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Unicode_D/trivial.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "trivial - Win32 Unicode Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "trivial___Win32_Unicode_Release" # PROP BASE Intermediate_Dir "trivial___Win32_Unicode_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Unicode_R" # PROP Intermediate_Dir "Unicode_R" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "UNICODE" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 log4cxx.lib /nologo /subsystem:console /machine:I386 /out:"../Bin/Unicode_R/trivial.exe" !ELSEIF "$(CFG)" == "trivial - Win32 Static Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "trivial___Win32_Static_Debug" # PROP BASE Intermediate_Dir "trivial___Win32_Static_Debug" # PROP BASE Ignore_Export_Lib 0 # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Static_Debug" # PROP Intermediate_Dir "Static_Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "LOG4CXX_STATIC" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 log4cxx.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Debug/trivial.exe" /pdbtype:sept # ADD LINK32 log4cxxs.lib Ws2_32.lib odbc32.lib Advapi32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../Bin/Static Debug/trivial.exe" /pdbtype:sept !ENDIF # Begin Target # Name "trivial - Win32 Release" # Name "trivial - Win32 Debug" # Name "trivial - Win32 Unicode Debug" # Name "trivial - Win32 Unicode Release" # Name "trivial - Win32 Static Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\examples\trivial.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: Makefile.am --- EXTRA_DIST = examples.dsw trivial.dsp trivial.vcproj --- NEW FILE: examples.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "trivial"=".\trivial.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:44
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx/db In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx/db Added Files: Makefile.am odbcappender.h Log Message: --- NEW FILE: Makefile.am --- dbincdir = $(includedir)/log4cxx/db dbinc_HEADERS= $(top_srcdir)/include/log4cxx/db/*.h --- NEW FILE: odbcappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_DB_ODBC_APPENDER_H #define _LOG4CXX_DB_ODBC_APPENDER_H #include <log4cxx/config.h> #ifdef HAVE_ODBC #include <log4cxx/helpers/exception.h> #include <log4cxx/appenderskeleton.h> #include <log4cxx/spi/loggingevent.h> #include <list> #ifdef HAVE_MS_ODBC #include <windows.h> #endif #include <sqlext.h> namespace log4cxx { namespace db { class LOG4CXX_EXPORT SQLException : public helpers::Exception { public: SQLException(int code) : code(code) {} virtual String getMessage() { return String(); } int code; }; class ODBCAppender; typedef helpers::ObjectPtrT<ODBCAppender> ODBCAppenderPtr; /** <p><b>WARNING: This version of ODBCAppender is very likely to be completely replaced in the future. Moreoever, it does not log exceptions.</b> </p> The ODBCAppender provides for sending log events to a database. <p>Each append call adds to an <code>ArrayList</code> buffer. When the buffer is filled each log event is placed in a sql statement (configurable) and executed. <b>BufferSize</b>, <b>db URL</b>, <b>User</b>, & <b>Password</b> are configurable options in the standard log4j ways. <p>The <code>setSql(String sql)</code> sets the SQL statement to be used for logging -- this statement is sent to a <code>PatternLayout</code> (either created automaticly by the appender or added by the user). Therefore by default all the conversion patterns in <code>PatternLayout</code> can be used inside of the statement. (see the test cases for examples) <p>Overriding the {@link #getLogStatement} method allows more explicit control of the statement used for logging. <p>For use as a base class: <ul> <li>Override getConnection() to pass any connection you want. Typically this is used to enable application wide connection pooling. <li>Override closeConnection -- if you override getConnection make sure to implement <code>closeConnection</code> to handle the connection you generated. Typically this would return the connection to the pool it came from. <li>Override getLogStatement to produce specialized or dynamic statements. The default uses the sql option value. </ul> */ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton { protected: /** * URL of the DB for default connection handling */ String databaseURL; /** * User to connect as for default connection handling */ String databaseUser; /** * User to use for default connection handling */ String databasePassword; /** * Connection used by default. The connection is opened the first time it * is needed and then held open until the appender is closed (usually at * garbage collection). This behavior is best modified by creating a * sub-class and overriding the <code>getConnection</code> and * <code>closeConnection</code> methods. */ SQLHDBC connection; SQLHENV env; /** * Stores the string given to the pattern layout for conversion into a SQL * statement, eg: insert into LogTable (Thread, File, Message) values * ("%t", "%F", "%m") * * Be careful of quotes in your messages! * * Also see PatternLayout. */ String sqlStatement; /** * size of LoggingEvent buffer before writting to the database. * Default is 1. */ size_t bufferSize; /** * ArrayList holding the buffer of Logging Events. */ std::list<spi::LoggingEventPtr> buffer; public: DECLARE_LOG4CXX_OBJECT(ODBCAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(ODBCAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() ODBCAppender(); virtual ~ODBCAppender(); /** Set options */ virtual void setOption(const String& option, const String& value); /** * Adds the event to the buffer. When full the buffer is flushed. */ void append(const spi::LoggingEventPtr& event); /** * By default getLogStatement sends the event to the required Layout object. * The layout will format the given pattern into a workable SQL string. * * Overriding this provides direct access to the LoggingEvent * when constructing the logging statement. * */ protected: String getLogStatement(const spi::LoggingEventPtr& event) const; /** * * Override this to provide an alertnate method of getting * connections (such as caching). One method to fix this is to open * connections at the start of flushBuffer() and close them at the * end. I use a connection pool outside of ODBCAppender which is * accessed in an override of this method. * */ void execute(const String& sql) /*throw(SQLException)*/; /** * Override this to return the connection to a pool, or to clean up the * resource. * * The default behavior holds a single connection open until the appender * is closed (typically when garbage collected). */ virtual void closeConnection(SQLHDBC con); /** * Override this to link with your connection pooling system. * * By default this creates a single connection which is held open * until the object is garbage collected. */ virtual SQLHDBC getConnection() /*throw(SQLException)*/; /** * Closes the appender, flushing the buffer first then closing the default * connection if it is open. */ public: virtual void close(); /** * loops through the buffer of LoggingEvents, gets a * sql string from getLogStatement() and sends it to execute(). * Errors are sent to the errorHandler. * * If a statement fails the LoggingEvent stays in the buffer! */ void flushBuffer(); /** * ODBCAppender requires a layout. * */ virtual bool requiresLayout() const { return true; } /** * Set pre-formated statement eg: insert into LogTable (msg) values ("%m") */ void setSql(const String& s); /** * Returns pre-formated statement eg: insert into LogTable (msg) values ("%m") */ inline const String& getSql() const { return sqlStatement; } inline void setUser(const String& user) { databaseUser = user; } inline void setURL(const String& url) { databaseURL = url; } inline void setPassword(const String& password) { databasePassword = password; } inline void setBufferSize(size_t newBufferSize) { bufferSize = newBufferSize; } inline const String& getUser() const { return databaseUser; } inline const String& getURL() const { return databaseURL; } inline const String& getPassword() const { return databasePassword; } inline size_t getBufferSize() const { return bufferSize; } }; // class ODBCAppender } // namespace db }; // namespace log4cxx #endif // HAVE_ODBC #endif // _LOG4CXX_NET_SOCKET_APPENDER_H |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:43
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/performance In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/performance Added Files: Makefile.am logging.sh main.cpp nullappender.cpp nullappender.h Log Message: --- NEW FILE: logging.sh --- # Test the performance of logging # Set the variable REMOTE_HOST to the appropriate value for the # to perform SocketAppender measurements. LCF=logging.lcf TARGET_FILE=test DELAY=1000 PORT=12345 # The results are somehow RUN_LENGTH dependent. Keep RUN_LENGTH the # same to be able to compare results LONGRUN=100000 SHORTRUN=5000 #LONGRUN=1 #SHORTRUN=2 declare -i start=$1 #D=-Dlog4j.configDebug # ------------------------------------------------------------- function multiRun() { lcf=$1 loopLength=$2 msg=$3 runLength=$4 echo -n "Results: " declare -i total declare -i i i=0 total=0 while [ $i -lt $loopLength ] do i=$i+1 x=$(./logging $lcf $runLength $5) if [ $x -lt 100 ]; then echo -n " " fi echo -n "$x " total=$total+$x done while [ $i -lt 8 ] do i=$i+1 echo -n " " done average=$[ $total / $loopLength ] echo "- average $average $msg" } # ============================================= # Echo to $LCF # ============================================= function lecho { echo $* >> $LCF } # ============================================= echo "--------------" $(date) "---------------" echo echo "Starting performance measures. This make take a few minutes...." declare -i TEST echo; echo "NullAppender:"; echo TEST=1 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 4 "SimpleLayout" $LONGRUN fi TEST=2 if [ $TEST -ge $start ]; then format="%p - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=3 if [ $TEST -ge $start ]; then format="%-5p - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=4 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 4 "TTCCLayout/RELATIVE" $LONGRUN fi TEST=5 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %c{2} %x - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=6 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %.10c %x - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=7 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %.20c %x - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=8 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %c - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=9 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 4 "TTCCLayout/ISO8601" $LONGRUN fi TEST=10 if [ $TEST -ge $start ]; then format="%d{ISO8601} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=11 if [ $TEST -ge $start ]; then format="%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $LONGRUN fi TEST=12 if [ $TEST -ge $start ]; then format="%l - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $SHORTRUN fi TEST=13 if [ $TEST -ge $start ]; then format="%F.%L - %m%n" multiRun xml/logging$TEST.xml 4 "PatternLayout \"$format\"" $SHORTRUN fi echo echo "FileAppender: " echo TEST=100 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "SimpleLayout" $LONGRUN fi TEST=101 if [ $TEST -ge $start ]; then format="%p - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=102 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCC/RELATIVE" $LONGRUN fi TEST=103 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %c - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=104 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCCLayout/ISO8601" $LONGRUN fi TEST=105 if [ $TEST -ge $start ]; then format="%d{ISO8601} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=106 if [ $TEST -ge $start ]; then format="%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi echo ================== 107 =============================== TEST=107 if [ $TEST -ge $start ]; then format="%l - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $SHORTRUN fi echo ------------------------------------- echo "FileAppender: ImmediateFlush=false" echo ------------------------------------- TEST=200 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "SimpleLayout" $LONGRUN fi TEST=201 if [ $TEST -ge $start ]; then format="%p - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=202 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCC/RELATIVE" $LONGRUN fi TEST=203 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %c - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=204 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCCLayout/ISO8601" $LONGRUN fi TEST=205 if [ $TEST -ge $start ]; then format="%d{ISO8601} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=206 if [ $TEST -ge $start ]; then format="%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=207 if [ $TEST -ge $start ]; then format="%l - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $SHORTRUN fi echo ------------------------------------- echo "FileAppender: BufferedIO=true" echo ------------------------------------- TEST=220 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "SimpleLayout" $LONGRUN fi TEST=221 if [ $TEST -ge $start ]; then format="%p - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=222 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCC/RELATIVE" $LONGRUN fi TEST=223 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %c - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=224 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCCLayout/ISO8601" $LONGRUN fi TEST=225 if [ $TEST -ge $start ]; then format="%d{ISO8601} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=226 if [ $TEST -ge $start ]; then format="%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=227 if [ $TEST -ge $start ]; then format="%l - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $SHORTRUN fi echo ================================== echo Async appender echo ================================== TEST=300 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "SimpleLayout" $LONGRUN fi TEST=301 if [ $TEST -ge $start ]; then format="%p - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=302 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCCLayout/RELATIVE" $LONGRUN fi TEST=303 if [ $TEST -ge $start ]; then format="%r [%t] %-5p %c - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=304 if [ $TEST -ge $start ]; then multiRun xml/logging$TEST.xml 8 "TTCCLayout/ISO8601" $LONGRUN fi TEST=305 if [ $TEST -ge $start ]; then format="%d{ISO8601} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=306 if [ $TEST -ge $start ]; then format="%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $LONGRUN fi TEST=307 if [ $TEST -ge $start ]; then format="%l - %m%n" multiRun xml/logging$TEST.xml 8 "PatternLayout \"$format\"" $SHORTRUN fi # =============================================================== # Remote logging # =============================================================== TEST=1000 #RL=1000 RL=10000 if [ $TEST -ge $start ]; then ./logging xml/logging$TEST.xml $RL 100 100 #multiRun 4 "SocketAppender" $SHORTRUN $DELAY fi TEST=1001 #RL=1000 RL=30000 if [ $TEST -ge $start ]; then ./logging xml/logging$TEST.xml $RL #multiRun 4 "SocketAppender" $SHORTRUN $DELAY fi --- NEW FILE: nullappender.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_PERFORMANCE_NULL_APPENDER_H #define _LOG4CXX_PERFORMANCE_NULL_APPENDER_H #include <log4cxx/config.h> #include <log4cxx/helpers/tchar.h> #include <log4cxx/appenderskeleton.h> namespace log4cxx { class Layout; typedef helpers::ObjectPtrT<Layout> LayoutPtr; namespace performance { class NullAppender; typedef helpers::ObjectPtrT<NullAppender> NullAppenderPtr; /** * A bogus appender which calls the format method of its layout object * but does not write the result anywhere. * */ class NullAppender : public AppenderSkeleton { public: StringBuffer sbuf; DECLARE_LOG4CXX_OBJECT(NullAppender) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(NullAppender) LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) END_LOG4CXX_CAST_MAP() NullAppender(); NullAppender(const LayoutPtr& layout); void close(); void doAppend(const spi::LoggingEventPtr& event); void append(const spi::LoggingEventPtr& event); /** This is a bogus appender but it still uses a layout. */ bool requiresLayout() const; }; // NullAppender } // namespace performance }; // namespace log4cxx #endif //_LOG4CXX_PERFORMANCE_NULL_APPENDER_H --- NEW FILE: Makefile.am --- SUBDIRS = xml noinst_PROGRAMS = logging performanceincdir = $(includedir)/log4cxx noinst_HEADERS= $(top_srcdir)/performance/*.h INCLUDES = -I$(top_srcdir)/include logging_SOURCES = main.cpp nullappender.cpp logging_LDADD = $(top_builddir)/src/liblog4cxx.la EXTRA_DIST = logging.sh --- NEW FILE: main.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/helpers/tchar.h> #include <log4cxx/ndc.h> #include <log4cxx/logmanager.h> #include <log4cxx/logger.h> #include <log4cxx/helpers/exception.h> #include <log4cxx/helpers/optionconverter.h> #include <log4cxx/xml/domconfigurator.h> #include <log4cxx/helpers/system.h> #include <log4cxx/helpers/thread.h> using namespace log4cxx; using namespace log4cxx::helpers; int runLength; int delay = -1; /* A delay is applied after every <code>burstLen</code> log requests. The default value of this constant is 100. */ int burstLen = 100; int DELAY_MULT = 1000/burstLen; LoggerPtr logger = Logger::getLogger(_T("A0123456789.B0123456789.C0123456789")); void Usage(const String& processName, const String& msg) { tcerr << msg << std::endl; tcerr << _T("Usage: ") << processName << _T(" confFile runLength [delay] [burstLen]") << std::endl << _T(" confFile is an XML configuration file and") << std::endl << _T(" runLength (integer) is the length of test loop.") << std::endl << _T(" delay is the time in millisecs to wait every burstLen log requests.") << std::endl; exit(EXIT_FAILURE); } void init(const String& configFile, const String& runLengthStr, const String& delayStr, const String& burstLenStr) { runLength = OptionConverter::toInt(runLengthStr, runLength); if (runLength < 1) { throw IllegalArgumentException(_T("run Length must be greater than 0")); } if (!delayStr.empty()) { delay = OptionConverter::toInt(delayStr, delay); } if (!burstLenStr.empty()) { burstLen = OptionConverter::toInt(burstLenStr, burstLen); DELAY_MULT = 1000/burstLen; } #ifdef HAVE_XML xml::DOMConfigurator::configure(configFile); #endif } double NoDelayLoop(LoggerPtr logger, const String& msg) { int64_t before = System::currentTimeMillis(); for(int i = 0; i < runLength; i++) { logger->info(msg, __FILE__, __LINE__); } int64_t after = System::currentTimeMillis(); return ((after - before)*1000.0)/runLength; } double DelayedLoop(LoggerPtr logger, const String& msg) { int64_t before = System::currentTimeMillis(); int j = 0; for(int i = 0; i < runLength; i++) { logger->info(msg); if(j++ == burstLen) { j = 0; try { Thread::sleep(delay); } catch(Exception&) { } } } double actualTime = ((System::currentTimeMillis()-before)*1000.0/runLength); tcout << "actual time: " << actualTime << std::endl; return (actualTime - delay*DELAY_MULT); } int main(int argc, char* argv[]) { int ret = EXIT_SUCCESS; try { USES_CONVERSION; if(argc == 3) init(A2T(argv[1]), A2T(argv[2]), String(), String()); else if(argc == 5) init(A2T(argv[1]), A2T(argv[2]), A2T(argv[3]), A2T(argv[4])); else Usage(A2T(argv[0]), _T("Wrong number of arguments.")); NDC::push(_T("some context")); double delta; String msg = _T("ABCDEGHIJKLMNOPQRSTUVWXYZabcdeghijklmnopqrstuvwxyz1234567890"); if(delay <= 0) { delta = NoDelayLoop(logger, msg); } else { delta = DelayedLoop(logger, msg); } tcout << (int)delta << std::endl; LogManager::shutdown(); } catch(Exception&) { ret = EXIT_FAILURE; } return ret; } --- NEW FILE: nullappender.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "nullappender.h" using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::spi; using namespace log4cxx::performance; IMPLEMENT_LOG4CXX_OBJECT(NullAppender) NullAppender::NullAppender() { } NullAppender::NullAppender(const LayoutPtr& layout) { this->layout = layout; } void NullAppender::close() { } void NullAppender::doAppend(const LoggingEventPtr& event) { if (layout != 0) { sbuf.seekp(0); layout->format(sbuf, event); } } void NullAppender::append(const LoggingEventPtr& event) { } /** This is a bogus appender but it still uses a layout. */ bool NullAppender::requiresLayout() const { return true; } |
Update of /cvsroot/objecthandler/log4cxx-0.9.7 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784 Added Files: AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README autogen.sh configure.in license.apl Log Message: --- NEW FILE: license.apl --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --- NEW FILE: COPYING --- See license.apl --- NEW FILE: configure.in --- AC_INIT(src/logger.cpp) # autoconf 2.50 or higher to rebuild aclocal.m4, because the # AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro. AC_PREREQ(2.50) AC_CANONICAL_HOST AC_CANONICAL_TARGET # # +1 : ? : +1 == new interface that does not break old one # +1 : ? : 0 == new interface that breaks old one # ? : ? : 0 == no new interfaces, but breaks apps # ? :+1 : ? == just some internal changes, nothing breaks but might work # better # CURRENT : REVISION : AGE LT_VERSION=9:0:0 AC_SUBST(LT_VERSION) AM_CONFIG_HEADER(include/log4cxx/config_auto.h) AH_VERBATIM([HAVE_NO_EXPLICIT_EXPORTS], [/* no explicit exports */ #define LOG4CXX_EXPORT]) AM_INIT_AUTOMAKE(log4cxx, 0.9.7) # Checks for programs # ---------------------------------------------------------------------------- AM_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_CXX([g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC]) AC_PROG_CXXCPP AC_LANG(C++) # CXX fine tuning case "$host" in *-dec-osf*) CXXFLAGS="$CXXFLAGS -std strict_ansi_errors" ;; *) ;; esac # Doxygen AC_ARG_ENABLE(doxygen, AC_HELP_STRING(--enable-doxygen, [enable documentation generation with doxygen (auto)])) AC_ARG_ENABLE(dot, AC_HELP_STRING(--enable-dot, [use 'dot' to generate graphs in doxygen (auto)])) AC_ARG_ENABLE(html-docs, AC_HELP_STRING(--enable-html-docs, [enable HTML generation with doxygen (yes)]), [], [enable_html_docs=yes]) AC_ARG_ENABLE(latex-docs, AC_HELP_STRING(--enable-latex-docs, [enable LaTeX documentation generation with doxygen (no)]), [], [enable_latex_docs=no]) if test "x$enable_doxygen" = xno; then enable_doc=no else AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) if test "x$DOXYGEN" = x; then if test "x$enable_doxygen" = xyes; then AC_MSG_ERROR([could not find doxygen]) fi enable_doc=no else enable_doc=yes AC_PATH_PROG(DOT, dot, , $PATH) fi fi AM_CONDITIONAL(DOC, test x$enable_doc = xyes) AM_CONDITIONAL(LATEX_DOC, test x$enable_latex_docs = xyes) if test x$DOT = x; then if test "x$enable_dot" = xyes; then AC_MSG_ERROR([could not find dot]) fi enable_dot=no else enable_dot=yes fi AC_SUBST(enable_dot) AC_SUBST(enable_html_docs) AC_SUBST(enable_latex_docs) # CppUnit AC_ARG_ENABLE(cppunit, AC_HELP_STRING(--enable-cppunit, [enable test excution with cppunit (auto)])) enable_tests=yes if test "x$enable_cppunit" = xno; then enable_tests=no else AC_CHECK_PROG(CPPUNIT_CONFIG, cppunit-config, yes, no) if test "x$CPPUNIT_CONFIG" = "xyes" then LIBS_CPPUNIT="`cppunit-config --libs`" CPPFLAGS_CPPUNIT="`cppunit-config --cflags`" AC_SUBST(LIBS_CPPUNIT) AC_SUBST(CPPFLAGS_CPPUNIT) else AC_MSG_WARN(cppunit not found !) fi AC_CHECK_HEADER([cppunit/TestFixture.h],, enable_tests=no) fi AC_HAVE_LIBRARY([boost_regex],, enable_tests=no) AC_CHECK_HEADERS([boost/regex.hpp],, enable_tests=no) AM_CONDITIONAL(TESTS, test x$enable_tests = xyes) # Checks header files # ---------------------------------------------------------------------------- AC_CHECK_HEADERS(unistd.h io.h alloca.h) # Checks local idioms # ---------------------------------------------------------------------------- # for SysLogAppender AC_CHECK_FUNCS(syslog) # Checks for libraries # ---------------------------------------------------------------------------- AC_PROG_RANLIB # for threads AC_MSG_CHECKING(for thread support) AC_ARG_WITH(thread, AC_HELP_STRING(--with-thread, [thread support. Accepted arguments : pthread, Microsoft, no (default=pthread)]), [ac_with_thread=$withval], [ac_with_thread=pthread]) case "$ac_with_thread" in Microsoft) AC_DEFINE(HAVE_MS_THREAD, 1, thread support through Microsoft threads.) AC_DEFINE(HAVE_THREAD, 1, thread support) AC_MSG_RESULT(Microsoft) ;; pthread) AC_MSG_RESULT(pthread) AC_CHECK_HEADER(pthread.h,, AC_MSG_ERROR(pthread library not found !)) AC_DEFINE(HAVE_PTHREAD, 1, thread support through pthread library.) AC_DEFINE(HAVE_THREAD, 1, thread support) case "$host" in *freebsd*) CPPFLAGS="$CPPLAGS -D_THREAD_SAFE" LIBS="-pthread $LIBS" ;; *solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" LIBS="-lpthread -lrt $LIBS" ;; *) CPPFLAGS="$CPPFLAGS -D_REENTRANT" LIBS="-lpthread $LIBS" ;; esac ;; no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT(???) AC_MSG_ERROR(Unknown option : $ac_with_thread) ;; esac # for SocketAppender AC_CHECK_FUNCS(gethostbyname,, [AC_CHECK_LIB(nsl,gethostbyname,, [AC_CHECK_LIB(socket,gethostbyname)])]) AC_CHECK_FUNCS(setsockopt,,[AC_CHECK_LIB(socket,setsockopt)]) # for DOMConfigurator AC_MSG_CHECKING(for XML support) AC_ARG_WITH(XML, AC_HELP_STRING(--with-XML, [XML support. Accepted arguments : libxml2, Microsoft, no (default=libxml2)]), [ac_with_xml=$withval], [ac_with_xml=libxml2] ) case "$ac_with_xml" in Microsoft) AC_DEFINE(HAVE_MS_XML, 1, ODBC support through Microsoft XML.) AC_DEFINE(HAVE_XML, 1, XML support) AC_MSG_RESULT(Microsoft) ;; libxml2) AC_MSG_RESULT(libxml2) AC_CHECK_PROG(XML2_CONFIG, xml2-config, yes, no) if test "x$XML2_CONFIG" = "xyes" then AC_DEFINE(HAVE_LIBXML2, 1, XML support through libxml2.) AC_DEFINE(HAVE_XML, 1, XML support) LIBS_XML="`xml2-config --libs`" CPPFLAGS_XML="`xml2-config --cflags`" else AC_MSG_WARN(libxml2 not found !) fi ;; no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT(???) AC_MSG_ERROR(Unknown option : $ac_with_xml) ;; esac AC_SUBST(LIBS_XML) AC_SUBST(CPPFLAGS_XML) #for UNICODE AC_MSG_CHECKING(for UTF-16 Unicode support) AC_ARG_ENABLE(unicode, AC_HELP_STRING(--enable-unicode, [UTF-16 Unicode support (default=no)]), AC_DEFINE(UNICODE, 1, UTF-16 Unicode support.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) #for ODBCAppender AC_MSG_CHECKING(for ODBC support) AC_ARG_WITH(ODBC, AC_HELP_STRING(--with-ODBC, [ODBC support. Accepted arguments : unixODBC, iODBC, Microsoft, no (default=no)]), [ac_with_odbc=$withval], [ac_with_odbc=no]) case "$ac_with_odbc" in Microsoft) AC_DEFINE(HAVE_MS_ODBC, 1, ODBC support through Microsoft ODBC.) AC_DEFINE(HAVE_ODBC, 1, ODBC support) AC_MSG_RESULT(Microsoft) LIBS_ODBC="-lodbc32" ;; unixODBC) AC_MSG_RESULT(unixODBC) AC_CHECK_HEADER(sqlext.h,, AC_MSG_ERROR(unixODBC not found !)) AC_DEFINE(HAVE_UNIX_ODBC, 1, ODBC support through unixODBC.) AC_DEFINE(HAVE_ODBC, 1, ODBC support) LIBS_ODBC="-lodbc" ;; iODBC) AC_MSG_RESULT(iODBC) AC_CHECK_PROG(IODBC_CONFIG, iodbc-config, yes, no) if test "x$IODBC_CONFIG" = "xyes" then AC_DEFINE(HAVE_I_ODBC, 1, ODBC support through iODBC.) AC_DEFINE(HAVE_ODBC, 1, ODBC support) LIBS_ODBC="`iodbc-config --libs`" CPPFLAGS_ODBC="`iodbc-config --cflags`" else AC_MSG_ERROR(iODBC not found !) fi ;; no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT(???) AC_MSG_ERROR(Unknown option : $ac_with_odbc) ;; esac AC_SUBST(LIBS_ODBC) AC_SUBST(CPPFLAGS_ODBC) #for System AC_CHECK_FUNCS(gettimeofday ftime setenv) #for SMTPAppender AC_MSG_CHECKING(for SMTP support) AC_ARG_WITH(SMTP, AC_HELP_STRING(--with-SMTP, [SMTP support. Accepted arguments : libsmtp, CDO, no (default=no)]), [ac_with_smtp=$withval], [ac_with_smtp=no]) case "$ac_with_smtp" in CDO) AC_MSG_RESULT(CDO) AC_DEFINE(HAVE_CDO_SMTP, 1, SMTP support through Microsoft CDO.) AC_DEFINE(HAVE_SMTP, 1, SMTP support) ;; libsmtp) AC_MSG_RESULT(libsmtp) AC_CHECK_LIB([smtp_mime], [libsmtp_session_initialize],, AC_MSG_ERROR(libsmtp library not found !), `glib-config --libs` -lsmtp) AC_DEFINE(HAVE_LIBSMTP, 1, SMTP support through libsmtp library.) AC_DEFINE(HAVE_SMTP, 1, SMTP support) LIBS="`glib-config --libs` -lsmtp $LIBS" CPPFLAGS="`glib-config --cflags` $CPPFLAGS" ;; no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT(???) AC_MSG_ERROR(Unknown option : $ac_with_smtp) ;; esac #for _T case "$host" in *apple-darwin*) AC_DEFINE(MUST_UNDEF_T, 1, Defined to 1 if macro _T has to be undefined) ;; esac # Create files # ---------------------------------------------------------------------------- AC_CONFIG_FILES([ Makefile docs/Makefile docs/Doxyfile src/Makefile include/Makefile include/log4cxx/Makefile include/log4cxx/helpers/Makefile include/log4cxx/net/Makefile include/log4cxx/nt/Makefile include/log4cxx/spi/Makefile include/log4cxx/varia/Makefile include/log4cxx/xml/Makefile include/log4cxx/config/Makefile include/log4cxx/db/Makefile tests/Makefile tests/input/Makefile tests/input/xml/Makefile tests/src/Makefile tests/src/customlogger/Makefile tests/src/defaultinit/Makefile tests/src/helpers/Makefile tests/src/net/Makefile tests/src/pattern/Makefile tests/src/util/Makefile tests/src/xml/Makefile tests/src/varia/Makefile tests/witness/Makefile performance/Makefile performance/xml/Makefile examples/Makefile msvc/Makefile msvc/examples/Makefile msvc/simplesocketserver/Makefile msvc/static/Makefile msvc/tests/Makefile msvc/performance/Makefile ]) AC_OUTPUT --- NEW FILE: ChangeLog --- Version 0.9.7 (2004-05-10) ========================== * Fixed examples source code in the "Short introduction to log4cxx". * Fixed, in the renaming algorithm of RollingFileAppender and DailyRollingFileAppender, a problem specific to Unicode. * Fixed conflict with Windows macros "min" and "max", by renaming StrictMath::min and StrictMath::max to StrictMath::minimum and StrictMath::maximum. * Port to HPUX 11.0. * Fixed segmentation fault in PropertyConfigurator. * Port to Solaris. * Fixed MutexException thrown while destroying RollingFileAppender. * Logging macros can be used without explicity declaring the use of log4cxx namespace. * Fixed static library unresolved externals for msvc 6 and 7.1 Version 0.9.6 (2004-04-11) ========================== * Timezone management has been optimized through the class TimeZone * Inter-thread synchronization and reference counting has been optimized * Reference counting now uses gcc atomic functions (bug 929078) * Use of StringBuffer has been optimized. * Support of localisation throug resourceBundles * SyslogAppender now uses the system function 'syslog' to log on the local host. (only for POSIX systems) * Added TimeZone configuration to PatternLayout (bug 912563) * Support of the DailyRollingFileAppender (feature request 842765) Version 0.9.5 (2004-02-04) ========================== * Port of log4j Jnuit tests with Cppunit and Boost Regex. * Added explicit exports for MSDEV 6 and MSDEV 7 (no further need of .def files) * Custom levels can be configured through the DOMConfigurator and PropertyConfigurator classes (Level inherites from Object) * Added a reference counter to LoggingEvent to avoid useless copies (LoggingEvent inherites from Object) * The file log4j.xml as well as the file log4j.properties are now search for, in log4cxx initialization. * The root logger can be assigned the "OFF" level. * Added MSVC6 project missing files mutext.cpp & condition.cpp (bug 847397) * condition.cpp now compiles with MSVC6 (bug 847417) * fixed pure virtual function call in PropertyConfigurator::configureAndWatch (bug 848521) * XMLAppender now displays correct timestamp with MSVC 6 (bug 852836) * SRLPORT 4.6 support. * Fixed an infinite loop in class Properties. * Fixed compilations problems with unicode. * Fixed SocketAppender bug concerning MDC ans NDC. Version 0.9.4 (2003-10-25) ========================== * StringBuffer has been optimized. * Fixed miscellaneous threading problems. * Added TimeZone support in PatternLayout (bug 796894) * Fixed threading configuration problems (bug 809125) * Fixed miscellaneous MSVC and cygwin compilation problems. Version 0.9.3 (2003-09-19) ========================== * Changed tstring to log4cxx::String and tostringstream to log4cxx::StringBuffer. * Fixed MSVC 2003 compilation erros and warnings. * Added helpers for NDC and MDC. * Added TimeZone support in TTCCLayout. * Fixed compilation problems with logger macros (LOG4CXX_...) * Fixed milliseconds formatting problem with MSVC 6.0 and 2003 * Fixed AsyncAppender crash * Added new tests * Added benchmarks Version 0.9.2 (2003-08-10) ========================== * Fixed FreeBSD compilation problem with pthread mutex (class CriticalSection). * Fixed milliseconds formatting problem (class DateFormat). * Long events (> 1024 chars) are now supported in the class XMLSocketAppender. * Carriage returns have been normalized in the class XMLLayout. Version 0.9.1 (2003-08-06) ========================== * Fixed deadlock problems in classes Logger and AsyncAppender. * Fixed MSVC 6.0 compilation problems. * Added MSVC 6.0 static libraty project. * Default configuration for the SMTP options is "no". Version 0.9.0 (2003-08-06) ========================== * Added ODBCAppender (matching log4j JDBCAppender) * Added SyslogAppender * Added SMTPAppender (only for Linux/FreeBSD) * Added BasicConfigurator * Added a FileWatchDog in PropertyConfigurator and DOMConfigurator * Possibility to load a custom LoggerFactory through the DOMConfigurator * Changed time precision from seconds to milliseconds * Added MSVC 6.0 'Unicode Debug' and 'Unicode Release' targets * Added Java like System class. Version 0.1.1 (2003-07-09) ========================== * Fixed MSVC 6.0 compilation problems concerning the 'Release' target * Added MSVC 6.0 tests projects Version 0.1.0 (2003-07-08) ========================== * FreeBSD Autotools/Compilation support * Fixed TelnetAppender crash when a socket bind exception occured. * Added log4j DTD support to XMLLayout and DOMConfigurator * Can now send events in XML format over TCP (class XMLSocketAppender) for the log4j Chainsaw UI * Now compiles with 'configure --enable-unicode' (UTF16 Unicode support) * Added Java like Properties class. It's a helper for the PropertyConfigurator * Added Java like objects with dynamic cast and instanciation. Custom objects can be configured through the DOMConfigurator and PropertyConfigurator classes * Port of the PropertyConfigurator class * Port of the "Map Diagnostic Context" (MDC) class * Added 13 tests (try make check) Version 0.0.1 (2003-05-31) ========================== Loggers, Hierarchy, Filters, Appenders, Layouts, NDC * Appenders: AsyncAppender, ConsoleAppender, FileAppender, NTEventLogAppender, RollingFileAppender, SocketAppender, SocketHubAappender, TelnetAppender * Layouts: HTMLLayout, PatternLayout, SimpleLayout, TTCCLayout, XMLLayout * Filters: DenyAllFilter, LevelMatchFilter, LevelRangeFilter, StringMatchFilter * Configurators: DOMConfigurator --- NEW FILE: Makefile.am --- SUBDIRS = docs src msvc include tests performance examples EXTRA_DIST = autogen.sh configure include license.apl dist-hook: rm -rf\ `find $(distdir) -name Makefile`\ `find $(distdir) -name Makefile.in`\ `find $(distdir) -name CVS`\ $(distdir)/aclocal.m4\ $(distdir)/config.guess\ $(distdir)/config.sub\ $(distdir)/configure\ $(distdir)/depcomp\ $(distdir)/install-sh\ $(distdir)/ltmain.sh\ $(distdir)/missing\ $(distdir)/mkinstalldirs\ $(distdir)/include/log4cxx/stamp*\ $(distdir)/include/log4cxx/config.h* --- NEW FILE: INSTALL --- Basic Installation ================== The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It also create a `config.h' file containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `AUTHORS' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code. 2. type `./autogen.sh' to generate the configure script. If you're using `csh' on an old version of System V, you might need to type `sh ./autogen.sh' instead to prevent `csh' from trying to execute `autogen.sh' itself. 3. type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 4. Type `make' to compile the package. 5. Optionally, type `make check' to run any self-tests that come with the package. 6. Type `make install' to install the programs and any data files and documentation. 7. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= With --enable-unicode, the library will be compiled with UTF16 Unicode support (2 bytes wide characters instead of 1 byte wide characters) If the libXML2 library (http://xmlsoft.org) is detected, the DOMConfigurator class will be compiled. Threading support can be added through option -with-thread * "pthread" (default): pthread library * "Microsoft" : native microsoft library * "no" : no threading support ODBC support (ODBCAppender) can be added through option -with-ODBC * "unixODBC" : unixODBC library (http://www.unixodbc.org) * "iODBC" : iODBC library (http://www.iodbc.org) * "Microsoft" : Microsoft ODBC library * "no" (default) : no ODBC support SMTP support (SMTPAppender) can be added through option -with-SMTP * "libsmtp" : libsmtp library (http://libsmtp.berlios.de) * "CDO" : Microsoft CDO library (no yet implemented !) * "no" (default) : no SMTP support XML support (DOMConfigurator) can be added through option -with-XML * "libxm2" (default) : gnome xml library (http://xmlsoft.org) * "Microsoft" : MSXML library * "no" : no XML support Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. MsDev 6.0 Compilation ===================== Copy the msvc/config.h.msvc file to include/log4cxx/config.h. If you want to compile a dynamic library (dll), compile msvc/dll/dll.dsp. If you want to compile a static library (lib), compile msvc/static/static.dsp. The DOMConfigurator class is compiled with the MSXML library, if 'HAVE_XML' and 'HAVE_MS_XML' are defined in the config.h file. The ODBCAppender class is compiled with the Microsoft ODBC library, if 'HAVE_ODBC' and 'HAVE_MS_ODBC' are defined in the config.h file. The SMTPAppender class is compiled with the Microsoft CDO library, if 'HAVE_SMTP' and 'HAVE_CDO_SMTP' are defined in the config.h file. (not yet implemented) log4cxx is build with Windows native thread support, if 'HAVE_THREAD' and 'HAVE_MS_THREAD' are defined in the config.h file. UNICODE support is available through 'Unicode Debug' and 'Unicode Release' compilation targets. Visual Studio .Net 2003 Compilation =================================== Copy the msvc/config.h.msvc file to include/log4cxx/config.h. If you want to compile a dynamic library (dll), compile msvc/dll/dll.vcproj. If you want to compile a static library (lib), compile msvc/static/static.vcproj. The config file options are same as for MsDev 6.0 --- NEW FILE: AUTHORS --- Michael CATANZARITI <mc...@us...> Edmond NOLAN <log...@us...> --- NEW FILE: README --- Introduction ============ Log4cxx is a port to C++ of the log4j project. The goal is have the same functionnalities and interfaces of log4j. Features ======== It's a flexible and highly configurable logging framework Main features : - Configurable logging destinations (appenders) - Configurable logging format (layouts) - Categorized logging statements through a hierarchy (loggers) - Advanced filtering (filters) - Thread safe library - UTF-16 Unicode support * Appenders: AsyncAppender, ConsoleAppender, DailyRollingFileAppender, FileAppender, NTEventLogAppender, ODBCAppender, RollingFileAppender, SMTPAppender, SocketAppender, SocketHubAappender, SyslogAppender, TelnetAppender, XMLSocketAppender * Layouts: HTMLLayout, PatternLayout, SimpleLayout, TTCCLayout, XMLLayout * Filters: DenyAllFilter, LevelMatchFilter, LevelRangeFilter, StringMatchFilter * Configurators: BasicConfigurator, DOMConfigurator, PropertyConfigurator * Java like objects with dynamic cast and instanciation. Custom objects can be configured through the DOMConfigurator and PropertyConfigurator classes Supported OS ============ * Linux (tested on Linux Mandrake 10.0) * FreeBSD * Windows (MSVC 6.0, MSVC 7.1 or Cygwin) * Other POSIX OS should be supported but were not tested Installation ============ ./autogen.sh ./configure make make check make install See INSTALL file for further details. Visual Studio .Net 2003 and Visual Studio 6.0 considerations ============================================================ For projects linking with log4cxx static library, the macro LOG4CXX_STATIC must be defined (tab C++, textbox Preprocessor in the project properties) and "log4cxxs.lib" must be passed to the linker (tab Link,textbox Object/Library Modules in the project settings). For projects linking with log4cxx dynamic library (dll), "log4cxx.lib" must be passed to the linker (tab Link,textbox Object/Library Modules in the project settings). Unitary Tests ============= You will need to install * cppunit (http://cppunit.sourceforge.net/) * boost regex (http://www.boost.org/) Unix : run "make check" Windows : run msvc/tests/runtests.bat Performance Tests ================= Just run performance/logging.sh. The result are expressed in micro-seconds. Links ===== http://logging.apache.org/log4cxx Log4cxx project page http://logging.apache.org/log4j Log4j project page Contacts ======== See AUTHORS file License ======= This library is licensed under the Apache Public License. Please read the included license.apl for details. --- NEW FILE: NEWS --- See the `http://sourceforge.net/news/?group_id=82335' page --- NEW FILE: autogen.sh --- #! /bin/sh # Regenerate the files autoconf / automake libtoolize --force --automake rm -f config.cache rm -f config.log aclocal autoheader autoconf automake -a |
From: Eric E. <eri...@us...> - 2006-05-25 11:41:43
|
Update of /cvsroot/objecthandler/log4cxx-0.9.7/examples In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/examples Added Files: Makefile.am delayedloop.cpp trivial.cpp Log Message: --- NEW FILE: delayedloop.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <log4cxx/logger.h> #include <log4cxx//helpers/stringhelper.h> #include <log4cxx/xml/domconfigurator.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/helpers/thread.h> using namespace log4cxx; using namespace log4cxx::helpers; /** This test program sits in a loop and logs things. Its logging is configured by a configuration file. Changes to this configuration file are monitored and when a change occurs, the config file is re-read. */ class DelayedLoop { static LoggerPtr logger; public: static void main(int argc, char **argv) { if(argc == 2) { USES_CONVERSION; init(A2T(argv[1])); } else { usage(argv[0], "Wrong number of arguments."); } test(); } static void usage(const char * programName, const char * msg) { std::cout << msg << std::endl; std::cout << "Usage: " << programName << " configFile" << std::endl; exit(1); } static void init(const String& configFile) { #ifdef HAVE_XML if(StringHelper::endsWith(configFile, _T("xml"))) { xml::DOMConfigurator::configureAndWatch(configFile, 3000); } else #endif { PropertyConfigurator::configureAndWatch(configFile, 3000); } } static void test() { int i = 0; while(true) { LOG4CXX_DEBUG(logger, _T("MSG ") << i++); try { Thread::sleep(1000); } catch(Exception& e) { } } } }; LoggerPtr DelayedLoop::logger = Logger::getLogger(_T("DelayedLoop")); int main(int argc, char **argv) { int result = EXIT_SUCCESS; try { DelayedLoop::main(argc, argv); } catch(Exception&) { result = EXIT_FAILURE; } return result; } --- NEW FILE: Makefile.am --- noinst_PROGRAMS = trivial delayedloop INCLUDES = -I$(top_srcdir)/include trivial_SOURCES = trivial.cpp trivial_LDADD = $(top_builddir)/src/liblog4cxx.la delayedloop_SOURCES = delayedloop.cpp delayedloop_LDADD = $(top_builddir)/src/liblog4cxx.la --- NEW FILE: trivial.cpp --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdlib.h> #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/helpers/exception.h> #include <log4cxx/ndc.h> using namespace log4cxx; using namespace log4cxx::helpers; int main() { int result = EXIT_SUCCESS; try { BasicConfigurator::configure(); LoggerPtr rootLogger = Logger::getRootLogger(); NDC::push(_T("trivial context")); rootLogger->debug(_T("debug message")); rootLogger->info(_T("info message")); rootLogger->warn(_T("warn message")); rootLogger->error(_T("error message")); rootLogger->fatal(_T("fatal message")); } catch(Exception&) { result = EXIT_FAILURE; } return result; } |
Update of /cvsroot/objecthandler/log4cxx-0.9.7/include/log4cxx/varia In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/include/log4cxx/varia Added Files: Makefile.am denyallfilter.h fallbackerrorhandler.h levelmatchfilter.h levelrangefilter.h stringmatchfilter.h Log Message: --- NEW FILE: levelrangefilter.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_VARIA_LEVEL_RANGE_FILTER_H #define _LOG4CXX_VARIA_LEVEL_RANGE_FILTER_H #include <log4cxx/spi/filter.h> #include <log4cxx/level.h> namespace log4cxx { namespace varia { /** This is a very simple filter based on level matching, which can be used to reject messages with priorities outside a certain range. <p>The filter admits three options <b>LevelMin</b>, <b>LevelMax</b> and <b>AcceptOnMatch</b>. <p>If the level of the {@link spi::LoggingEvent LoggingEvent} is not between Min and Max (inclusive), then {@link spi::Filter#DENY DENY} is returned. <p> If the Logging event level is within the specified range, then if <b>AcceptOnMatch</b> is true, {@link spi::Filter#ACCEPT ACCEPT} is returned, and if <b>AcceptOnMatch</b> is false, {@link spi::Filter#NEUTRAL NEUTRAL} is returned. <p>If <code>LevelMin</code>w is not defined, then there is no minimum acceptable level (ie a level is never rejected for being too "low"/unimportant). If <code>LevelMax</code> is not defined, then there is no maximum acceptable level (ie a level is never rejected for beeing too "high"/important). <p>Refer to the {@link AppenderSkeleton#setThreshold setThreshold} method available to <code>all</code> appenders extending AppenderSkeleton for a more convenient way to filter out events by level. */ class LevelRangeFilter; typedef helpers::ObjectPtrT<LevelRangeFilter> LevelRangeFilterPtr; class LOG4CXX_EXPORT LevelRangeFilter : public spi::Filter { private: static String LEVEL_MIN_OPTION; static String LEVEL_MAX_OPTION; static String ACCEPT_ON_MATCH_OPTION; /** Do we return ACCEPT when a match occurs. Default is <code>false</code>, so that later filters get run by default */ bool acceptOnMatch; LevelPtr levelMin; LevelPtr levelMax; public: typedef spi::Filter BASE_CLASS; DECLARE_LOG4CXX_OBJECT(LevelRangeFilter) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(LevelRangeFilter) LOG4CXX_CAST_ENTRY_CHAIN(BASE_CLASS) END_LOG4CXX_CAST_MAP() LevelRangeFilter(); /** Set options */ virtual void setOption(const String& option, const String& value); /** Set the <code>LevelMin</code> option. */ void setLevelMin(const LevelPtr& levelMin) { this->levelMin = levelMin; } /** Get the value of the <code>LevelMin</code> option. */ const LevelPtr& getLevelMin() const { return levelMin; } /** Set the <code>LevelMax</code> option. */ void setLevelMax(const LevelPtr& levelMax) { this->levelMax = levelMax; } /** Get the value of the <code>LevelMax</code> option. */ const LevelPtr& getLevelMax() const { return levelMax; } /** Set the <code>AcceptOnMatch</code> option. */ inline void setAcceptOnMatch(bool acceptOnMatch) { this->acceptOnMatch = acceptOnMatch; } /** Get the value of the <code>AcceptOnMatch</code> option. */ inline bool getAcceptOnMatch() const { return acceptOnMatch; } /** Return the decision of this filter. Returns {@link spi::Filter#NEUTRAL NEUTRAL} if the <b>LevelToMatch</b> option is not set or if there is not match. Otherwise, if there is a match, then the returned decision is {@link spi::Filter#ACCEPT ACCEPT} if the <b>AcceptOnMatch</b> property is set to <code>true</code>. The returned decision is {@link spi::Filter#DENY DENY} if the <b>AcceptOnMatch</b> property is set to false. */ FilterDecision decide(const spi::LoggingEventPtr& event) const; }; // class LevelMatchFilter } // namespace varia }; // namespace log4cxx #endif // _LOG4CXX_VARIA_LEVEL_RANGE_FILTER_H --- NEW FILE: stringmatchfilter.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_VARIA_STRING_MATCH_FILTER_H #define _LOG4CXX_VARIA_STRING_MATCH_FILTER_H #include <log4cxx/spi/filter.h> namespace log4cxx { namespace varia { /** This is a very simple filter based on string matching. <p>The filter admits two options <b>StringToMatch</b> and <b>AcceptOnMatch</b>. If there is a match between the value of the StringToMatch option and the message of the {@link spi::LoggingEvent LoggingEvent}, then the #decide method returns {@link spi::Filter#ACCEPT ACCEPT} if the <b>AcceptOnMatch</b> option value is true, if it is false then {@link spi::Filter#DENY DENY} is returned. If there is no match, {@link spi::Filter#NEUTRAL NEUTRAL} is returned. <p>See configuration files <a href="../xml/doc-files/test6.xml">test6.xml</a>, <a href="../xml/doc-files/test7.xml">test7.xml</a>, <a href="../xml/doc-files/test8.xml">test8.xml</a>, <a href="../xml/doc-files/test9.xml">test9.xml</a>, and <a href="../xml/doc-files/test10.xml">test10.xml</a> for examples of seeting up a <code>StringMatchFilter</code>. */ class StringMatchFilter; typedef helpers::ObjectPtrT<StringMatchFilter> StringMatchFilterPtr; class LOG4CXX_EXPORT StringMatchFilter : public spi::Filter { private: static String STRING_TO_MATCH_OPTION; static String ACCEPT_ON_MATCH_OPTION; bool acceptOnMatch; String stringToMatch; public: typedef spi::Filter BASE_CLASS; DECLARE_LOG4CXX_OBJECT(StringMatchFilter) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(StringMatchFilter) LOG4CXX_CAST_ENTRY_CHAIN(BASE_CLASS) END_LOG4CXX_CAST_MAP() StringMatchFilter(); /** Set options */ virtual void setOption(const String& option, const String& value); inline void setStringToMatch(const String& stringToMatch) { this->stringToMatch = stringToMatch; } inline const String& getStringToMatch() const { return stringToMatch; } inline void setAcceptOnMatch(bool acceptOnMatch) { this->acceptOnMatch = acceptOnMatch; } inline bool getAcceptOnMatch() const { return acceptOnMatch; } /** Returns {@link spi::Filter#NEUTRAL NEUTRAL} is there is no string match. */ FilterDecision decide(const spi::LoggingEventPtr& event) const; }; // class StringMatchFilter } // namespace varia }; // namespace log4cxx #endif // _LOG4CXX_VARIA_STRING_MATCH_FILTER_H --- NEW FILE: levelmatchfilter.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_VARIA_LEVEL_MATCH_FILTER_H #define _LOG4CXX_VARIA_LEVEL_MATCH_FILTER_H #include <log4cxx/spi/filter.h> #include <log4cxx/level.h> namespace log4cxx { class Level; namespace varia { /** This is a very simple filter based on level matching. <p>The filter admits two options <b>LevelToMatch</b> and <b>AcceptOnMatch</b>. If there is an exact match between the value of the <b>LevelToMatch</b> option and the level of the {@link spi::LoggingEvent LoggingEvent}, then the #decide method returns {@link spi::Filter#ACCEPT ACCEPT} in case the <b>AcceptOnMatch</b> option value is set to <code>true</code>, if it is <code>false</code> then {@link spi::Filter#DENY DENY} is returned. If there is no match, {@link spi::Filter#NEUTRAL NEUTRAL} is returned. */ class LevelMatchFilter; typedef helpers::ObjectPtrT<LevelMatchFilter> LevelMatchFilterPtr; class LOG4CXX_EXPORT LevelMatchFilter : public spi::Filter { private: static String LEVEL_TO_MATCH_OPTION; static String ACCEPT_ON_MATCH_OPTION; bool acceptOnMatch; LevelPtr levelToMatch; public: typedef spi::Filter BASE_CLASS; DECLARE_LOG4CXX_OBJECT(LevelMatchFilter) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(LevelMatchFilter) LOG4CXX_CAST_ENTRY_CHAIN(BASE_CLASS) END_LOG4CXX_CAST_MAP() LevelMatchFilter(); /** Set options */ virtual void setOption(const String& option, const String& value); void setLevelToMatch(const String& levelToMatch); const String& getLevelToMatch() const; inline void setAcceptOnMatch(bool acceptOnMatch) { this->acceptOnMatch = acceptOnMatch; } inline bool getAcceptOnMatch() const { return acceptOnMatch; } /** Return the decision of this filter. Returns {@link spi::Filter#NEUTRAL NEUTRAL} if the <b>LevelToMatch</b> option is not set or if there is not match. Otherwise, if there is a match, then the returned decision is {@link spi::Filter#ACCEPT ACCEPT} if the <b>AcceptOnMatch</b> property is set to <code>true</code>. The returned decision is {@link spi::Filter#DENY DENY} if the <b>AcceptOnMatch</b> property is set to false. */ FilterDecision decide(const spi::LoggingEventPtr& event) const; }; // class LevelMatchFilter } // namespace varia }; // namespace log4cxx #endif // _LOG4CXX_VARIA_STRING_MATCH_FILTER_H --- NEW FILE: denyallfilter.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_VARIA_DENY_ALL_FILTER_H #define _LOG4CXX_VARIA_DENY_ALL_FILTER_H #include <log4cxx/spi/filter.h> namespace log4cxx { namespace varia { /** This filter drops all logging events. <p>You can add this filter to the end of a filter chain to switch from the default "accept all unless instructed otherwise" filtering behaviour to a "deny all unless instructed otherwise" behaviour. */ class DenyAllFilter; typedef helpers::ObjectPtrT<DenyAllFilter> DenyAllFilterPtr; class LOG4CXX_EXPORT DenyAllFilter : public spi::Filter { public: typedef spi::Filter BASE_CLASS; DECLARE_LOG4CXX_OBJECT(DenyAllFilter) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(DenyAllFilter) LOG4CXX_CAST_ENTRY_CHAIN(BASE_CLASS) END_LOG4CXX_CAST_MAP() /** Always returns the integer constant {@link spi::Filter#DENY DENY} regardless of the {@link spi::LoggingEvent LoggingEvent} parameter. @param event The LoggingEvent to filter. @return Always returns {@link spi::Filter#DENY DENY}. */ FilterDecision decide(const spi::LoggingEventPtr& event) const { return spi::Filter::DENY; } }; // class DenyAllFilter } // namespace varia }; // namespace log4cxx #endif // _LOG4CXX_VARIA_DENY_ALL_FILTER_H --- NEW FILE: Makefile.am --- variaincdir = $(includedir)/log4cxx/varia variainc_HEADERS= $(top_srcdir)/include/log4cxx/varia/*.h --- NEW FILE: fallbackerrorhandler.h --- /* * Copyright 2003,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_VARIA_FALLBACK_ERROR_HANDLER_H #define _LOG4CXX_VARIA_FALLBACK_ERROR_HANDLER_H #include <log4cxx/spi/errorhandler.h> #include <log4cxx/helpers/objectimpl.h> #include <log4cxx/appender.h> #include <log4cxx/logger.h> #include <vector> namespace log4cxx { namespace varia { /** The <code>FallbackErrorHandler</code> implements the ErrorHandler interface such that a secondary appender may be specified. This secondary appender takes over if the primary appender fails for whatever reason. <p>The error message is printed on <code>System.err</code>, and logged in the new secondary appender. */ class LOG4CXX_EXPORT FallbackErrorHandler : public virtual spi::ErrorHandler, public virtual helpers::ObjectImpl { private: AppenderPtr backup; AppenderPtr primary; std::vector<LoggerPtr> loggers; public: DECLARE_LOG4CXX_OBJECT(FallbackErrorHandler) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(spi::OptionHandler) LOG4CXX_CAST_ENTRY(spi::ErrorHandler) END_LOG4CXX_CAST_MAP() FallbackErrorHandler(); /** <em>Adds</em> the logger passed as parameter to the list of loggers that we need to search for in case of appender failure. */ void setLogger(const LoggerPtr& logger); /** No options to activate. */ void activateOptions(); void setOption(const String& name, const String& value); /** Prints the message and the stack trace of the exception on <code>System.err</code>. */ void error(const String& message, helpers::Exception& e, int errorCode) const; /** Prints the message and the stack trace of the exception on <code>System.err</code>. */ void error(const String& message, helpers::Exception& e, int errorCode, const spi::LoggingEventPtr& event) const; /** Print a the error message passed as parameter on <code>System.err</code>. */ void error(const String& message) const {} /** Return the backup appender. */ const AppenderPtr& getBackupAppender() const { return backup; } /** The appender to which this error handler is attached. */ void setAppender(const AppenderPtr& primary); /** Set the backup appender. */ void setBackupAppender(const AppenderPtr& backup); }; } // namespace varia }; // namespace log4cxx #endif //_LOG4CXX_VARIA_FALLBACK_ERROR_HANDLER_H |