Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ea7701d
Initial conversion to markdown for use with Doxygen
rm5248 Sep 20, 2020
af80872
Merge branch 'master' into documentation-updates
rm5248 Dec 23, 2020
e44ac5a
Generate site thru cmake. Updated usage document
rm5248 Dec 23, 2020
fd5736f
Added layout file to add custom links
rm5248 Dec 23, 2020
d0900a9
Made project only 3 numbers instead of 4
rm5248 Dec 23, 2020
888b551
Changed the download page to be markdown
rm5248 Dec 23, 2020
f024b80
Converted community to markdown
rm5248 Dec 23, 2020
3e9bc52
Added mailing list info
rm5248 Dec 23, 2020
e318bec
Updated community and usage overview pages
rm5248 Dec 23, 2020
095ee7a
Added get section with license
rm5248 Dec 23, 2020
c448095
Added copyright information to footer
rm5248 Dec 23, 2020
f235ae9
Updated documentation on how to build log4cxx
rm5248 Dec 24, 2020
79ca2a0
Added ability to create and sign dist files
rm5248 Dec 24, 2020
61dbe78
Fix build on Windows
rm5248 Dec 24, 2020
17fec73
Revert "Made project only 3 numbers instead of 4"
rm5248 Dec 24, 2020
494790b
Revert "Fix build on Windows"
rm5248 Dec 24, 2020
09d3fd1
Reverted removal of tweak
rm5248 Dec 24, 2020
69ff95e
Added some configuration samples documentation
rm5248 Dec 24, 2020
45c3afb
changed syntax of file type
rm5248 Dec 24, 2020
c5ae5db
Make inline code blocks stand out like maven generation
rm5248 Dec 24, 2020
cb8ffde
Added links
rm5248 Dec 26, 2020
f8d120f
Generate the tar/zip with the correct name
rm5248 Dec 26, 2020
02e70f6
Minor formatting changes
rm5248 Dec 26, 2020
c1c0717
Merge branch 'master' into documentation-updates
rm5248 Dec 29, 2020
9a57350
Added table of contents to configuration samples
rm5248 Dec 30, 2020
fe0e5e7
Added ToC to usage page
rm5248 Dec 30, 2020
3cdacfe
Added documentation on removing log statements
rm5248 Dec 30, 2020
f5e4928
Added documentation about logging custom types
rm5248 Dec 31, 2020
8b33c58
Added documentation and example on how to extend log4cxx
rm5248 Dec 31, 2020
ebec5f1
Indent if statement. Add visual studio files to ignored CPack
rm5248 Jan 11, 2021
e78ce92
Put the site generation into its own dedicated CMakeLists
rm5248 Jan 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

ar-lib
config**
!configuration-samples.md
depcomp
install-sh
liblog4cxx.pc
Expand Down
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ include(CTest)
# (at least in the past it was project vesion: 0.a.b.c and the library so vesion a.b.c.0
set(LIBLOG4CXX_LIB_VERSION ${log4cxx_VERSION_MINOR}.${log4cxx_VERSION_PATCH}.${log4cxx_VERSION_TWEAK})
set(LIBLOG4CXX_LIB_SOVERSION ${log4cxx_VERSION_MINOR})
# Set the 'release' version. This is the human-readable version
set(LOG4CXX_RELEASE_VERSION ${log4cxx_VERSION_MAJOR}.${log4cxx_VERSION_MINOR}.${log4cxx_VERSION_PATCH})

# FindAPR and FindAPR-util are not provided by APR and APR-Util so source them locally
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/src/cmake")
Expand Down Expand Up @@ -103,6 +105,25 @@ foreach(varName HAS_STD_LOCALE HAS_ODBC HAS_MBSRTOWCS HAS_WCSTOMBS HAS_FWIDE
endif()
endforeach()

#
# Package and sign if Apache maintainer
#
option(APACHE_MAINTAINER "Apache maintainer" OFF)
if(APACHE_MAINTAINER)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}")
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set(CPACK_SOURCE_IGNORE_FILES ".git/;build/;.vs/;out/")
include(CPack)

add_custom_target( dist
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} -- package_source
COMMAND ${CMAKE_COMMAND} -E sha512sum "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.tar.gz" > "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.tar.gz.sha512"
COMMAND ${CMAKE_COMMAND} -E sha512sum "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.zip" > "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.zip.sha512"
COMMAND gpg -ab --yes "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.tar.gz" > "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.tar.gz.asc"
COMMAND gpg -ab --yes "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.zip" > "apache-log4cxx-${LOG4CXX_RELEASE_VERSION}.zip.asc"
)
endif()

#
# Output configuration information
# Similar to APR CMake configuration
Expand All @@ -114,6 +135,7 @@ message(STATUS "")

message(STATUS " Build shared library ............ : ${BUILD_SHARED_LIBS}")
message(STATUS " Build tests ..................... : ${BUILD_TESTING}")
message(STATUS " Build site ...................... : ${BUILD_SITE}")
message(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
message(STATUS " C++ compiler .................... : ${CMAKE_CXX_COMPILER}")
message(STATUS " log4cxx char API ................ : ${LOG4CXX_CHAR}")
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ if(BUILD_TESTING)
add_subdirectory(test)
add_subdirectory(examples/cpp)
endif()

add_subdirectory(site)
6 changes: 5 additions & 1 deletion src/examples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
set(ALL_LOG4CXX_EXAMPLES console delayedloop stream trivial)
set(ALL_LOG4CXX_EXAMPLES console delayedloop stream trivial custom-appender)

foreach(exampleName IN LISTS ALL_LOG4CXX_EXAMPLES)
add_executable(${exampleName} ${exampleName}.cpp)
target_compile_definitions(${exampleName} PRIVATE ${LOG4CXX_COMPILE_DEFINITIONS} ${APR_COMPILE_DEFINITIONS} ${APR_UTIL_COMPILE_DEFINITIONS} )
target_include_directories(${exampleName} PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
target_link_libraries(${exampleName} PRIVATE log4cxx ${APR_UTIL_LIBRARIES} ${XMLLIB_LIBRARIES} ${APR_LIBRARIES} ${APR_SYSTEM_LIBS})
endforeach()

configure_file( custom-appender.xml
${CMAKE_CURRENT_BINARY_DIR}/custom-appender.xml
COPYONLY )
71 changes: 71 additions & 0 deletions src/examples/cpp/custom-appender.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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/basicconfigurator.h>
#include <log4cxx/helpers/object.h>
#include <log4cxx/appenderskeleton.h>
#include <log4cxx/helpers/stringhelper.h>
#include <log4cxx/xml/domconfigurator.h>

namespace log4cxx {

class NullWriterAppender : public log4cxx::AppenderSkeleton {
public:
DECLARE_LOG4CXX_OBJECT(NullWriterAppender)
BEGIN_LOG4CXX_CAST_MAP()
LOG4CXX_CAST_ENTRY(NullWriterAppender)
LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton)
END_LOG4CXX_CAST_MAP()

NullWriterAppender(){}

virtual void close(){}

virtual bool requiresLayout() const {
return false;
}

virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p){
// This gets called whenever there is a valid event for our appender.
}

virtual void activateOptions(log4cxx::helpers::Pool& /* pool */) {
// Given all of our options, do something useful(e.g. open a file)
}

virtual void setOption(const LogString& option, const LogString& value){
if (helpers::StringHelper::equalsIgnoreCase(option,
LOG4CXX_STR("SOMEVALUE"), LOG4CXX_STR("somevalue"))){
// Do something with the 'value' here.
}
}
};

IMPLEMENT_LOG4CXX_OBJECT(NullWriterAppender)

}

int main( int argc, char** argv ){
log4cxx::xml::DOMConfigurator::configure( "custom-appender.xml" );

log4cxx::LoggerPtr rootLogger = log4cxx::Logger::getRootLogger();
log4cxx::LoggerPtr nullLogger = log4cxx::Logger::getLogger( "NullLogger" );

LOG4CXX_INFO( rootLogger, "This is some root message" );
LOG4CXX_INFO( nullLogger, "This message will be discarded" );
}
22 changes: 22 additions & 0 deletions src/examples/cpp/custom-appender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}] %c %-5p - %m%n"/>
</layout>
</appender>

<appender name="NullAppender" class="NullWriterAppender">
<param name="SomeValue" value="Nothing"/>
</appender>

<root>
<priority value="info" />
<appender-ref ref="ConsoleAppender"/>
</root>

<logger name="NullLogger" additivity="false">
<appender-ref ref="NullAppender"/>
</logger>
</log4j:configuration>
15 changes: 15 additions & 0 deletions src/site/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
option(BUILD_SITE "Build log4cxx website" OFF)
if(BUILD_SITE)
find_package( Doxygen REQUIRED dot )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/doxy/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile )

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/markdown/download.md.in
${CMAKE_CURRENT_BINARY_DIR}/markdown/download.md )

add_custom_target( doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generate site with Doxygen"
VERBATIM )
endif()
147 changes: 0 additions & 147 deletions src/site/apt/building/cmake.apt

This file was deleted.

43 changes: 0 additions & 43 deletions src/site/apt/building/vcpkg.apt

This file was deleted.

Loading