{"id":13418316,"url":"https://github.com/log4cplus/log4cplus","last_synced_at":"2026-02-21T15:06:40.522Z","repository":{"id":13147743,"uuid":"15830219","full_name":"log4cplus/log4cplus","owner":"log4cplus","description":"log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. It is modelled after the Java log4j API.","archived":false,"fork":false,"pushed_at":"2026-02-11T06:46:55.000Z","size":27003,"stargazers_count":1722,"open_issues_count":62,"forks_count":565,"subscribers_count":89,"default_branch":"master","last_synced_at":"2026-02-11T14:21:40.966Z","etag":null,"topics":["cxx","log4cplus","logging","logging-library"],"latest_commit_sha":null,"homepage":"https://log4cplus.github.io/log4cplus/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/log4cplus.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-01-11T20:37:02.000Z","updated_at":"2026-02-11T06:46:59.000Z","dependencies_parsed_at":"2022-07-13T11:10:31.720Z","dependency_job_id":"dffa8edd-5886-49b2-b783-a09a1df1df8e","html_url":"https://github.com/log4cplus/log4cplus","commit_stats":{"total_commits":2191,"total_committers":47,"mean_commits":46.61702127659574,"dds":0.5303514376996805,"last_synced_commit":"4cd02bb7c513f9ae098ab34bccdaa57340e4531c"},"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"purl":"pkg:github/log4cplus/log4cplus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4cplus%2Flog4cplus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4cplus%2Flog4cplus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4cplus%2Flog4cplus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4cplus%2Flog4cplus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/log4cplus","download_url":"https://codeload.github.com/log4cplus/log4cplus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4cplus%2Flog4cplus/sbom","scorecard":{"id":597023,"data":{"date":"2025-08-11","repo":{"name":"github.com/log4cplus/log4cplus","commit":"64f42ab3bf2a48b2da753292b893073b4f9fe9c5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":4,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Warn: no linked content found","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:28","Warn: no topLevel permission defined: .github/workflows/android.yml:1","Warn: no topLevel permission defined: .github/workflows/c-cpp.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/android.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/log4cplus/log4cplus/android.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/c-cpp.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/log4cplus/log4cplus/c-cpp.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/log4cplus/log4cplus/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/log4cplus/log4cplus/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/log4cplus/log4cplus/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/log4cplus/log4cplus/codeql.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":8,"reason":"5 out of the last 5 releases have a total of 5 signed artifacts.","details":["Info: signed release artifact: log4cplus-2.1.2.7z.sig: https://github.com/log4cplus/log4cplus/releases/tag/REL_2_1_2","Info: signed release artifact: log4cplus-2.1.1.7z.sig: https://github.com/log4cplus/log4cplus/releases/tag/REL_2_1_1","Info: signed release artifact: log4cplus-2.1.0.7z.sig: https://github.com/log4cplus/log4cplus/releases/tag/REL_2_1_0","Info: signed release artifact: log4cplus-2.0.8.7z.sig: https://github.com/log4cplus/log4cplus/releases/tag/REL_2_0_8","Info: signed release artifact: log4cplus-2.0.7.7z.sig: https://github.com/log4cplus/log4cplus/releases/tag/REL_2_0_7","Warn: release artifact REL_2_1_2 does not have provenance: https://api.github.com/repos/log4cplus/log4cplus/releases/181790894","Warn: release artifact REL_2_1_1 does not have provenance: https://api.github.com/repos/log4cplus/log4cplus/releases/129936382","Warn: release artifact REL_2_1_0 does not have provenance: https://api.github.com/repos/log4cplus/log4cplus/releases/92094372","Warn: release artifact REL_2_0_8 does not have provenance: https://api.github.com/repos/log4cplus/log4cplus/releases/71624873","Warn: release artifact REL_2_0_7 does not have provenance: https://api.github.com/repos/log4cplus/log4cplus/releases/42906705"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during GetBranch(1.2.x): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (27) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T23:23:18.617Z","repository_id":13147743,"created_at":"2025-08-20T23:23:18.617Z","updated_at":"2025-08-20T23:23:18.617Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29388180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T00:02:39.825Z","status":"ssl_error","status_checked_at":"2026-02-13T00:00:20.807Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cxx","log4cplus","logging","logging-library"],"created_at":"2024-07-30T22:01:00.984Z","updated_at":"2026-02-21T15:06:40.497Z","avatar_url":"https://github.com/log4cplus.png","language":"C++","readme":"% log4cplus README\n\nShort Description\n=================\n\n[log4cplus] is a simple to use C++23 logging API providing thread--safe,\nflexible, and arbitrarily granular control over log management and\nconfiguration.  It is modeled after the Java log4j API.\n\n[log4cplus]: https://github.com/log4cplus/log4cplus\n\n\nLatest Project Information\n==========================\n\nThe latest up-to-date information for this project can be found on the\n[GitHub][13] project page or the [log4cplus wiki][4]. Please submit bugs,\npatches, feature requests, and so on on [GitHub][13].\n\n[4]: https://github.com/log4cplus/log4cplus/wiki\n[13]: https://github.com/log4cplus/log4cplus\n\n\nMission statement\n=================\n\nThe aim of this project is to develop a log4j-like logging framework for\nuse primarily in C++. One of the major design goals is to avoid\nhuge dependencies (like Boost) in the core functionality and to use\nstandard C++ facilities instead. Where possible, the project takes\ninspiration from other logging libraries, besides log4j (e.g.,\nfrom log4net, log4cxx, log4cpp).\n\n\nPlatform support\n================\n\n[log4cplus] version 3.0 and beyond require C++23. [log4cplus] has been\nported to and tested on the following platforms:\n\n  - Linux/AMD64 with GCC version 13.2.0 (Ubuntu 13.2.0-23ubuntu4)\n  - Linux/AMD64 with Clang version 18.1.3 (18.1.3-1ubuntu1)\n  - Windows/AMD64 with GCC version 4.8.2 (x86_64-posix-seh-rev3, Built by\n    MinGW-W64 project) using CMake build system\n  - Windows/AMD64 with GCC version 4.9.2 (tdm64-1) using CMake build system\n  - Windows 7 with MS Visual Studio 2015\n  - OpenBSD 5.6/AMD64 with GCC version 4.9.0\n  - FreeBSD 10.1/i386 with Clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032)\n  - NetBSD 6.1.5/AMD64 with GCC version 4.9.1\n  - DragonflyBSD 4.0.1/AMD64 with GCC version 4.9.3 20141126 (prerelease)\n    (FreeBSD Ports Collection)\n  - OpenIndiana Hipster 2016.10 with GCC version 4.9.4\n\nTesting on the above-listed platforms was done at some point in time\nwith some version of the source. Continuous testing is performed only\non the Linux platform offered by the [Travis CI][11] service.\n\nThe oldest Windows version that is supported by 2.x releases is Windows Vista.\n\nThe following platforms were supported by the 1.x series of [log4cplus]. They\neither do not have a reasonably C++23-capable compiler or have not yet been\nchecked with [log4cplus] 3.x:\n\n  - Minix 3.3.0/i386 with Clang version 3.4 (branches/release_34) with\n    `--disable-threads`\n  - Linux/AMD64 with Intel Parallel Studio XE 2015, ICPC version 15.0.1\n  - OpenSolaris with `-library=stlport4`\n  - Solaris with `-library=stlport4` and with `-library=Cstd`.\n  - Solaris 5.10/Sparc\n  - MacOS X 10.8\n  - MacOS X 11.4.2\n  - HP-UX (hppa2.0w-hp-hpux11.11)\n  - Haiku R1 Alpha 4.1\n  - AIX 5.3 with IBM XL C/C++ for AIX\n\n\nInstallation instructions\n=========================\n\nGeneric Autotools installation instructions are in the `INSTALL` file. The\nfollowing are [log4cplus]-specific instructions.\n\n[log4cplus] uses Git sub-modules. Always use `--recurse-submodules` option when\ndoing `git clone`.\n\n\nConfigure script options\n========================\n\n`--enable-debugging`\n--------------------\n\nThis option is disabled by default.  This option mainly affects GCC\nbuilds but it also has some limited effect on non-GCC builds.  It\nturns on debugging information generation, undefines `NDEBUG` symbol\nand adds `-fstack-check` (GCC).\n\n\n`--enable-warnings`\n-------------------\n\nThis option is enabled by default.  It adds platform / compiler\ndependent warning options to compiler command line.\n\n\n`--enable-so-version`\n---------------------\n\nThis option is enabled by default.  It enables SO version decoration\non resulting library file, e.g., the `.2.0.0` in\n`liblog4cplus-1.2.so.2.0.0`.\n\n\n`--enable-release-version`\n--------------------------\n\nThis option is enabled by default.  It enables release version\ndecoration on the resulting library file, e.g., the `-1.2` in\n`liblog4cplus-1.2.so.2.0.0`.\n\n\n`--enable-symbols-visibility-options`\n-------------------------------------\n\nThis option is enabled by default.  It enables use of compiler and\nplatform specific option for symbols visibility.  See also the\n[Visibility][8] page on GCC Wiki.\n\n[8]: http://gcc.gnu.org/wiki/Visibility\n\n\n`--enable-profiling`\n--------------------\n\nThis option is disabled by default.  This option adds profiling\ninformation generation compiler option `-pg` to GCC and Sun CC /\nSolaris Studio builds.\n\n\n`--enable-threads`\n------------------\n\nThis option is enabled by default.  It turns on detection of necessary\ncompiler and linker flags that enable POSIX threading support.\n\nWhile this detection usually works well, some platforms still need\nhelp with configuration by supplying additional flags to the\n`configure` script. One of the known deficiencies is Solaris Studio on\nLinux. See one of the later notes for details.\n\n\n`--enable-tests`\n----------------\n\nThis option is enabled by default.  It enables compilation of test executables.\n\n\n`--enable-unit-tests`\n---------------------\n\nThis option is disabled by default. It enables compilation of unit tests along\nwith their units. These unit tests can then be executed through the\n`unit_tests` test executable that is built during compilation.\n\n\n`--enable-implicit-initialization`\n----------------------------------\n\nThis option is enabled by default.  It enables implicit initialization of\n[log4cplus]. When it is turned off, [log4cplus] has to be explicitly\ninitialized by calling either `log4cplus::initialize()` or by instantiating\n`log4cplus::Initializer`.\n\n\n`--enable-lto`\n--------------\n\nThis option is disabled by default.  It enables LTO (Link-Time Optimization)\nbuilds.\n\n\n`--with-wchar_t-support`\n------------------------\n\nThis option is enabled by default.  When enabled, additional binaries will be\nbuilt, marked with `U` suffix in file name and compiled with `-DUNICODE=1`\nflag. In effect, these binaries assume that `log4cplus::tchar` is `wchar_t`.\n\n\n`--with-working-locale`\n-----------------------\n\nThis is one of three locale and `wchar_t`↔`char` conversion related\noptions.  It is disabled by default.\n\nIt is known to work well with GCC on Linux. Other platforms generally\nhave lesser locale support in their implementations of the C++\nstandard library.  It is known not to work well on any BSDs.\n\nSee also docs/unicode.txt.\n\n\n`--with-working-c-locale`\n-------------------------\n\nThis is the second of the `wchar_t`↔`char` conversion-related options. It is\ndisabled by default.\n\nIt is known to work well on most Unix--like platforms, including\nrecent Cygwin.\n\n\n`--with-iconv`\n--------------\n\nThis is the third of the `wchar_t`↔`char` conversion-related options. It is\ndisabled by default.\n\nThe conversion using iconv() function always uses `\"UTF-8\"` and\n`\"WCHAR_T\"` as source/target encoding.  It is known to work well on\nplatforms with GNU iconv.  Different implementations of `iconv()`\nmight not support `\"WCHAR_T\"` encoding selector.\n\nEither the system-provided `iconv()` or the library-provided `libiconv()` is\ndetected and accepted. Both SUSv3 and GNU `iconv()` function\nsignatures are accepted.\n\n\n`--with-qt`\n-----------\n\nThis option is disabled by default.  It enables compilation of a\nseparate shared library (liblog4cplusqt4debugappender) that implements\n`Qt4DebugAppender`.  It requires Qt4 and pkg-config to be installed.\n\n\n`--with-qt5`\n------------\n\nThis option is disabled by default.  It enables compilation of a separate\nshared library (liblog4cplusqt5debugappender) that implements\n`Qt5DebugAppender`.  It requires Qt5 and pkg-config to be available.\n\n\nNotes\n=====\n\nCompilation\n-----------\n\nOn Unix--like platforms, [log4cplus] can be compiled using either the\nAutotools-based build system or the CMake build system. The\nAutotools-based build system is considered to be primary for\nUnix--like platforms.\n\nOn Windows, the primary build system is Visual Studio 2015 solution\nand projects (`msvc14/log4cplus.sln`).\n\nMinGW is supported by the Autotools-based build system. The CMake build system\nis supported as well, and it should be used to compile [log4cplus] with\nolder versions of Visual Studio or with less common compiler suites\n(e.g., Embarcadero, Code::Blocks, etc.).\n\n\nCygwin\n------\n\nCygwin 2.5.x has a problem[^pr64697] linking binaries that use language-level\nthread-local storage and share thread-local variables across translation\nunits. To avoid the issue, language-level thread-local storage is not used on\nCygwin and traditional POSIX thread-local storage is used instead.\n\n[^pr64697]: \u003chttps://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697\u003e\n\n\nMinGW and MSVCRT version\n------------------------\n\n[log4cplus] can use functions like `_vsnprintf_s()` (Microsoft's\nsecure version of `vsnprintf()`). MinGW toolchains (by default) link\nto the system `MSVCRT.DLL`. Unfortunately, older systems, like Windows\nXP, ship with `MSVCRT.DLL` that lacks these functions. It is possible\nto compile [log4cplus] with MinGW toolchains but _without_ using\nMicrosoft's secure functions by defining `__MSVCRT_VERSION__` to a value\nless than `0x900` and vice versa.\n\n    $ ../configure CPPFLAGS=\"-D__MSVCRT_VERSION__=0x700\"\n\n\nWindows and Visual Studio\n-------------------------\n\n[log4cplus] uses C++11 thread and synchronization facilities. The\nsynchronization facilities are implemented in Visual Studio C++ standard\nlibrary in a way that utilizes global variables. Therefore it is impossible\n(due to \"static initialization order fiasco\") to use them outside\n`main()`. This issue manifests as a deadlock on exit during destruction of\n[log4cplus]' thread pool.\n\nTo overcome this limitation,\n\n  - always use `log4cplus::Initializer initializer;` as the first thing in\n`main()`;\n\n  - never try to log from static/global objects constructors;\n\n  - never try to log from static/global object destructors.\n\nDefining the `log4cplus::Initializer` instance as the first thing in `main()`\nensures that [log4cplus] is initialized. More importantly, it ensures that\n[log4cplus] shuts down before the execution leaves the `main()`\nfunction. [log4cplus] will try to automatically initialize at process startup\nand/or on DLL load, and will not tear down until all `log4cplus:Initializer`\ninstances are destroyed.\n\n\nWindows and rolling file Appenders\n----------------------------------\n\nOn Windows, the standard C++ file streams open files in a way that the\nunderlying Win32 file `HANDLE` is not opened with the `FILE_SHARE_DELETE`\nflag. This flag, besides shared delete, allows renaming files that have\nhandles open to them. This issue manifests as error code 13 when the file\nneeds to be rolled over while it is still open by another process.\n\nThis is also [bug #167](https://sourceforge.net/p/log4cplus/bugs/167/) on\nSourceForge.\n\n\nWindows and TLS\n---------------\n\n[log4cplus] uses thread--local storage (TLS) for NDC, MDC and to\noptimize use of some temporary objects.  On Windows there are two ways\nto get TLS:\n\n1. using `TlsAlloc()`, etc., functions\n2. using `__declspec(thread)`\n\nWhile method (2) generates faster code, it has\n[some limitations prior to Windows Vista][tlsvista].  If\n`log4cplus.dll` is loaded at run time using `LoadLibrary()` (or as a\ndependency of such loaded library), then accessing\n`__declspec(thread)` variables can cause general protection fault\n(GPF) errors.  This is because Windows prior to Windows Vista do not\nextend the TLS for libraries loaded at run time using `LoadLibrary()`.\nTo allow using the best available method, [log4cplus] enables the\nmethod (2) by checking `_WIN32_WINNT \u003e= 0x0600` condition, when\ncompiling [log4cplus] targeted to Windows Vista or later.\n\n[tlsvista]: https://learn.microsoft.com/en-us/cpp/parallel/thread-local-storage-tls?view=msvc-170\n\n\nLinking on Windows\n------------------\n\nIf you are linking your application with the DLL variant of [log4cplus], define\n`LOG4CPLUS_BUILD_DLL` preprocessor symbol. This changes definition of\n`LOG4CPLUS_EXPORT` symbol to `__declspec(dllimport)`.\n\n\nAndroid, TLS and CMake\n----------------------\n\n[log4cplus] uses thread--local storage (TLS, see \"Windows and TLS\" for\ndetails). On the Android platform, when [log4cplus] is being compiled using\nthe `android/android.toolchain.cmake`, you might get errors featuring the\n`__emutls` symbol:\n\n\n    global-init.cxx:268:46: error: log4cplus::internal::__emutls_t._ZN9log4cplus8internal3ptdE causes a section type conflict with log4cplus::internal::ptd\n\nTo work around this issue, invoke CMake with\n`-DANDROID_FUNCTION_LEVEL_LINKING:BOOL=OFF` option.\n\n\nThreads and signals\n-------------------\n\n[log4cplus] is not safe to be used from asynchronous signals'\nhandlers.  This is a property of most threaded programmes in general.\nIf you are going to use [log4cplus] in threaded application and if you\nwant to use [log4cplus] from signal handlers then your only option is\nto block signals in all threads but one that will handle all signals.\nOn POSIX platforms, this is possible using the `sigwait()` call.\n[log4cplus] enables this approach by blocking all signals in any\nthreads created through its threads helpers.\n\n\nIBM's XL C/C++ compiler\n-----------------------\n\nIBM's XL C/C++ compiler executable has [many variants][1].  To compile\n[log4cplus] with threading support specify one of the compiler\nvariants that support threading using the `CXX` variable on\n`configure` script command line.  E.g.:\n\n    $ ../configure --enable-threads CXX=xlC_r\n\n[1]: https://www.ibm.com/docs/en/xl-c-and-cpp-aix/13.1.0?topic=applications-invoking-compiler\n\n\nAIX reentrancy problem\n----------------------\n\nThere appears to be a reentrancy problem with AIX 5.3 and xlC 8 which\ncan result into a deadlock condition in some circumstances.  It is\nunknown whether the problem manifests with other versions of either\nthe OS or the compiler, too.  The problem was initially reported in a\nbug report [#103][2].\n\nThe core of the problem is that IBM's/xlC's standard C++ IOStreams\nimplementation uses global non recursive lock to protect some of its\nstate.  The application in the bug report was trying to do logging\nusing [log4cplus] from inside `overflow()` member function of a class\nderived from `std::streambuf` class.  [log4cplus] itself uses\n`std::ostringstream`.  This resulted into an attempt to recursively\nlock the global non recursive lock and a deadlock.\n\n[2]: https://sourceforge.net/p/log4cplus/bugs/103/\n\n\nSolaris / SunOS\n---------------\n\nSome older version of this operating system might have problems\nlinking [log4cplus] due to [missing `__tls_get_addr`][3] in their\nunpatched state.\n\n[3]: https://groups.google.com/g/comp.unix.solaris/c/AAMqkK0QZ6U/m/zlkVKA1L_QcJ\n\n\nSolaris Studio\n--------------\n\nSolaris Studio compilers' default standard C++ library is very\nnon-standard.  It seems that it is not conforming enough in, e.g., Sun\nC++ 5.12 Linux_i386 2011/11/16 (missing `std::time_t`, etc.), but it\nworks well enough on Solaris with Sun C++ 5.8 2005/10/13.  Thus\n[log4cplus] adds `-library=stlport4` to the `CXXFLAGS` environment\nvariable, unless a switch matching `-library=(stlport4|stdcxx4|Cstd)`\nis already present there.  If you want to override the default\nsupplied by [log4cplus], just set it into `CXXFLAGS` on `configure`\nscript command line.\n\nSolaris Studio supports the `__func__` symbol which can be used by\n[log4cplus] to record function name in logged events.  To enable this\nfeature, add `-features=extensions` switch to `CXXFLAGS` for\n`configure` script.  Subsequently, you will have to add this switch to\nyour application's build flags as well.\n\n\nSolaris Studio on GNU/Linux\n---------------------------\n\nThe Autotools and our `configure.ac` combination do not handle the Solaris\nStudio compiler on Linux well enough and need a little help with the\nconfiguration of POSIX threads:\n\n```sh\n$ COMMON_FLAGS=\"-L/lib/x86_64-linux-gnu/ \\\n-L/usr/lib/x86_64-linux-gnu/ -mt=yes -O\"\n\n$ ../configure --enable-threads=yes \\\nCC=/opt/solarisstudio12.3/bin/cc \\\nCXX=/opt/solarisstudio12.3/bin/CC \\\nCFLAGS=\"$COMMON_FLAGS\" \\\nCXXFLAGS=\"$COMMON_FLAGS\" \\\nLDFLAGS=\"-lpthread\"\n```\n\n\nHP-UX with `aCC`\n----------------\n\nIt is necessary to turn on C++98 mode of `aCC` by providing the `-AA`\nflag:\n\n    $ ../configure --enable-threads=yes CXXFLAGS=\"-AA\"\n\n\nHP-UX with `aCC` on IA64\n------------------------\n\nThere is a problem on IA64 HP-UX with `aCC` (HP C/aC++ B3910B\nA.06.20). The problem manifests as\n[unsatisfied symbols during linking of `loggingserver`][9]:\n\n    ld: Unsatisfied symbol \"virtual table of loggingserver::ClientThread\" in file loggingserver.o\n\nThe problem appears to be a deficiency in `aCC` and its support of\n`__declspec(dllexport)`. To work around this issue, add\n`--disable-symbols-visibility-options` to `configure` script command\nline:\n\n    $ ../configure --disable-symbols-visibility-options \\\n    --enable-threads=yes CXXFLAGS=\"-AA\"\n\n[9]: https://community.hpe.com/t5/languages-and-scripting/building-log4cplus-fails-with-quot-ld-unsatisfied-symbol-virtual/m-p/6262849#.Y_5ho4DMImM\n\n\nHaiku\n-----\n\nHaiku is supported with GCC 4+. The default GCC version in Haiku is\nset to version 2 (based on GCC 2.95.x). To change the default GCC\nversion to 4, please run the `setgcc gcc4` command. This is to\navoid linking errors like this:\n\n    main.cpp:(.text.startup+0x54a): undefined reference to `_Unwind_Resume'\n\nRunning the command switches the _current_ GCC version to version 4.\nThis change is permanent and global. See also the Haiku ticket\n[#8368](https://dev.haiku-os.org/ticket/8368).\n\n\nQt4 / Win32 / MSVC\n------------------\n\nIn order to use [log4cplus] in Qt4 programs it is necessary to set the\nfollowing option: `Treat WChar_t As Built-in Type: No (/Zc:wchar_t-)`\n\nSet this option for the [log4cplus] project and the `Qt4DebugAppender`\nproject in MS Visual Studio. Remember to use the Unicode versions of\n[log4cplus] libraries with Qt. It is also necessary to make a clear\ndistinction between debug and release builds of the Qt project and\n[log4cplus]. Do not use the [log4cplus] release library with the debug\nversion of a Qt program and vice versa.\n\nTo register the Qt4DebugAppender library at runtime, call this\nfunction: `log4cplus::Qt4DebugAppender::registerAppender()`\n\nAdd these lines to the qmake project file to use [log4cplus] and\n`Qt4DebugAppender`:\n\n    INCLUDEPATH += C:\\log4cplus\\include\n    win32 {\n        CONFIG(debug, debug|release) {\n            LIBS += -LC:\\log4cplus\\msvc14\\Win32\\bin.Debug_Unicode -llog4cplusUD\n            LIBS += -LC:\\log4cplus\\msvc14\\Win32\\bin.Debug_Unicode -llog4cplus-Qt4DebugAppender\n        } else {\n            LIBS += -LC:\\log4cplus\\msvc14\\Win32\\bin.Release_Unicode -llog4cplusU\n            LIBS += -LC:\\log4cplus\\msvc14\\Win32\\bin.Release_Unicode -llog4cplus-Qt4DebugAppender\n        }\n    }\n\n\nQt / GCC\n--------\n\nYou might encounter the following error during compilation with\n`--with-qt` option:\n\n    qglobal.h:943: error: ISO C++ does not support 'long long'\n\nThis is caused by `-pedantic` option that [log4cplus] adds to\n`CXXFLAGS` when compiling with GCC.  To work around this issue, add\n`-Wno-long-long` GCC option to `CXXFLAGS`.\n\n\nOpenBSD\n-------\n\nOpenBSD 5.2 and earlier have a bug in `wcsftime()` function in\nhandling of `%%` and `%N` where N is not a supported formatter. This\nis fixed in OpenBSD 5.3 and later. This shows as failing\n`timeformat_test` when [log4cplus] is compiled with `-DUNICODE` in\n`CXXFLAGS`.\n\n\niOS support\n-----------\n\niOS support is based on CMake build. Use the scripts in `iOS` directory. The\n`iOS.cmake` toolchain file was originally taken from [ios-cmake] project.\n\nTo build the library for iOS, being in current folder, perform the steps\nbelow. For ARMv7 architecture:\n\n    $ ./scripts/cmake_ios_armv7.sh\n    $ cmake --build ./build_armv7 --config \"Release\"\n    $ cmake --build ./build_armv7 --config \"Debug\"\n\nFor i386 architecture:\n\n    $ ./scripts/cmake_ios_i386.sh\n    $ cmake --build ./build_i386 --config \"Release\"\n    $ cmake --build ./build_i386 --config \"Debug\"\n\nSome versions of the iOS and/or its SDK have problems with thread-local storage\n(TLS) and getting through CMake's environment detection phase. To work around\nthese issues, make these changes:\n\nEdit the `iOS.cmake` file and add these two lines.\n\n    set (CMAKE_CXX_COMPILER_WORKS TRUE)\n    set (CMAKE_C_COMPILER_WORKS TRUE)\n\nAdd these lines, customizing them accordingly:\n\n    set(MACOSX_BUNDLE_GUI_IDENTIFIER com.example)\n    set(CMAKE_MACOSX_BUNDLE YES)\n    set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY \"iPhone Developer\")\n    set(IPHONEOS_ARCHS arm64)\n\nIf you have issues with TLS, also comment out these lines:\n\n    set(LOG4CPLUS_HAVE_TLS_SUPPORT 1)\n    set(LOG4CPLUS_THREAD_LOCAL_VAR \"__thread\")\n\n[ios-cmake]: https://code.google.com/p/ios-cmake/\n\n\n`LOG4CPLUS_*_FMT()` and UNICODE\n-------------------------------\n\nBeware, the `%s` specifier does not work the same way on Unix--like\nplatforms as it does on Windows with Visual Studio. With Visual Studio\nthe `%s` specifier changes its meaning by printing a `wchar_t` string\nwhen used with `wprintf()` and a `char` string when used with\n`printf()`. On the other hand, Unix-like platforms keep the meaning of\nprinting `char` strings when used with both `wprintf()` and\n`printf()`. It is necessary to use the `%ls` (C99) specifier or the `%S`\n(SUSv2) specifier to print `wchar_t` strings on Unix-like platforms.\n\nThe common ground for both platforms appears to be using `%ls` and a\n`wchar_t` string to print strings with an unmodified format string on\nboth Unix-like platforms and Windows. The conversion of `wchar_t` back\nto `char` then depends on the C locale.\n\n\nUnsupported compilers and platforms\n-----------------------------------\n\n[log4cplus] does not support too old or broken C++ compilers. Since [log4cplus]\nversion 3.0.0, it means it does not support any platform or compiler without\ndecent C++23 support.\n\n  - Visual Studio prior to 2015\n  - GCC prior to 4.8\n\n\nBug reporting instructions\n--------------------------\n\nFor successful resolution of reported bugs, it is necessary to provide enough information:\n\n- [log4cplus]\n    - What is the exact release version or Git branch and revision?\n    - What is the build system that you are building [log4cplus] with\n      (Autotools, Visual Studio solution and its version, CMake).\n    - Autotools -- Provide `configure` script parameters and environment\n      variables, attach generated `config.log` and `defines.hxx` files.\n    - CMake -- Provide build configuration (`Release`, `Debug`,\n      `RelWithDebInfo`) and non--default `CMAKE_*` variables values.\n    - Visual Studio -- Provide project configuration (`Release`,\n      `Release_Unicode`, `Debug`, `Debug_Unicode`) and Visual Studio version.\n    - Provide target OS and CPU. In case of MinGW, provide its exact compiler\n      distribution -- TDM? Nuwen? Other?\n\n- [log4cplus] client application\n    - Are you using shared library [log4cplus] or as static library [log4cplus]?\n    - Is [log4cplus] linked into an executable or into a shared library (DLL or\n      SO)?\n    - If [log4cplus] is linked into a shared library, is this library\n      loaded dynamically or not?\n    - What library file you are linking your application with --\n      `log4cplus.lib`, `log4cplusUSD.lib`, `liblog4cplus.dll.a`, etc., on\n      Windows?\n    - Is your application is using Unicode/`wchar_t` or not?\n    - Provide any error messages.\n    - Provide stack trace.\n    - Provide [log4cplus] properties/configuration files.\n    - Provide a self--contained test case, if possible.\n\n\nLicense\n=======\n\nThis library is licensed under the Apache Public License 2.0 and the\ntwo-clause BSD license. Please read the included [LICENSE](./LICENSE) file for\ndetails.\n\n\nContributions\n=============\n\n[log4cplus] (bug tracker, files, wiki) is hosted on GitHub. See also the\n[Contributions](https://github.com/log4cplus/log4cplus/wiki/Development#contributions)\ntopic on the wiki.\n\n\nPatches\n-------\n\nAnybody can contribute to log4cplus development.\nIf you are contributing a source code change, use a reasonable\nform: a merge request of a Git branch.\n\n\nFormatting\n----------\n\nPlease use common sense. Follow the style of the surrounding code. You can\nuse the following Emacs style, which is based on Microsoft's style, as a\nguideline:\n\n```lisp\n;; Custom MS like indentation style.\n(c-add-style \"microsoft\"\n             '(\"stroustrup\"\n               (c-offsets-alist\n                (innamespace . -)\n                (inline-open . 0)\n                (inher-cont . c-lineup-multi-inher)\n                (arglist-cont-nonempty . +)\n                (template-args-cont . +))))\n```\n\n\nTools\n-----\n\n### Build system\n\n[log4cplus] supports multiple build systems (GNU Autoconf/Automake/Libtool aka\nAutotools, CMake and Visual Studio solution and project files).\n\nAutotools is considered the primary build system on Unix--like\nplatforms. However, CMake should still be usable on Unix--like platforms as\nwell.\n\nOn Windows, it depends on the compiler and toolchain that you want to use. When\nusing Visual Studio, use Visual Studio solution and project files. However,\nthe CMake build system should still work and produce useful results. When using\nsome form of MinGW64 toolchain, the CMake build system is considered primary\nand the Autotools-based build system is unsupported. Use the `MinGW Makefiles`\noption and build with `mingw-make` (or similar). The `MSYS Makefiles` option is\nuntested and unsupported.\n\n#### Autotools\n\nThe `Makefile.am` files for this build system are hand-written. Some of them,\nhowever, are generated from `Makefile.am.tpl` and `Makefile.am.def` by\n[GNU Autogen][12]. This is to make adding new files to the source easier.\n\nTo regenerate `Makefile.am` files, `configure` script, `testsuite` script or\nany other part of the Autotools build system, use the `scripts/doautoreconf.sh`\nscript from the source root directory. It will invoke all the necessary tools in\nthe correct order.\n\n[log4cplus] closely follows Autoconf's, Automake's and Libtool's development\nand its master branch files are always generated using the latest available\nversion of the tools.\n\n[12]: https://www.gnu.org/software/autogen/\n","funding_links":[],"categories":["TODO scan for Android support in followings","Logging","Uncategorized","C++","进程间通信"],"sub_categories":["Uncategorized","日志"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog4cplus%2Flog4cplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flog4cplus%2Flog4cplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog4cplus%2Flog4cplus/lists"}