Optionally compile multiprocess stuff. Added basic documentation on multiprocess
diff --git a/src/main/cpp/timebasedrollingpolicy.cpp b/src/main/cpp/timebasedrollingpolicy.cpp
index 1d13d93..bb78514 100644
--- a/src/main/cpp/timebasedrollingpolicy.cpp
+++ b/src/main/cpp/timebasedrollingpolicy.cpp
@@ -300,6 +300,7 @@
m_priv->lastFileName = buf;
if( m_priv->multiprocess ){
+#if LOG4CXX_HAS_MULTIPROCESS_ROLLING_FILE_APPENDER
if (getPatternConverterList().size())
{
(*(getPatternConverterList().begin()))->format(obj, m_priv->_fileNamePattern, pool);
@@ -321,6 +322,7 @@
}
initMMapFile(m_priv->lastFileName, m_priv->_mmapPool);
+#endif
}
m_priv->suffixLength = 0;
@@ -401,6 +403,7 @@
LogString newFileName(buf);
if( m_priv->multiprocess ){
+#if LOG4CXX_HAS_MULTIPROCESS_ROLLING_FILE_APPENDER
m_priv->bAlreadyInitialized = true;
if (m_priv->_mmap && !isMapFileEmpty(m_priv->_mmapPool))
@@ -415,6 +418,7 @@
m_priv->_mmap = NULL;
initMMapFile(m_priv->lastFileName, m_priv->_mmapPool);
}
+#endif
}
//
@@ -463,6 +467,7 @@
}
if( m_priv->multiprocess ){
+#if LOG4CXX_HAS_MULTIPROCESS_ROLLING_FILE_APPENDER
if (m_priv->_mmap && !isMapFileEmpty(m_priv->_mmapPool))
{
lockMMapFile(APR_FLOCK_EXCLUSIVE);
@@ -475,6 +480,7 @@
m_priv->_mmap = NULL;
initMMapFile(newFileName, m_priv->_mmapPool);
}
+#endif
}else{
m_priv->lastFileName = newFileName;
}
@@ -489,7 +495,7 @@
size_t /* fileLength */)
{
if( m_priv->multiprocess ){
-
+#if LOG4CXX_HAS_MULTIPROCESS_ROLLING_FILE_APPENDER
if (m_priv->bRefreshCurFile && m_priv->_mmap && !isMapFileEmpty(m_priv->_mmapPool))
{
lockMMapFile(APR_FLOCK_SHARED);
@@ -507,6 +513,7 @@
}
return ( Date::currentTime() > m_priv->nextCheck) || (!m_priv->bAlreadyInitialized);
+#endif
}
return Date::currentTime() > m_priv->nextCheck;
diff --git a/src/site/markdown/1-usage.md b/src/site/markdown/1-usage.md
index 120b0b9..8d3d5a2 100644
--- a/src/site/markdown/1-usage.md
+++ b/src/site/markdown/1-usage.md
@@ -31,3 +31,4 @@
* @subpage qt-support
* @subpage performance
* @subpage map-filter
+* @subpage multiprocess-logging
diff --git a/src/site/markdown/multiprocess.md b/src/site/markdown/multiprocess.md
new file mode 100644
index 0000000..5c7e710
--- /dev/null
+++ b/src/site/markdown/multiprocess.md
@@ -0,0 +1,36 @@
+Multiprocess Logging {#multiprocess-logging}
+===
+<!--
+ Note: License header cannot be first, as doxygen does not generate
+ cleanly if it before the '==='
+-->
+<!--
+ 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.
+-->
+
+# Logging With Multiple Processes
+
+If you have multiple applications that all log to the same file, it is often
+desirable that the file that these applications write to will roll over when
+required. In order for that to happen, Log4cxx supplies a
+`MultiprocessRollingFileAppender` that will check the size of the file when
+writing to the file and roll it over appropriately.
+
+This is an optional feature, and thus must be explicitly enabled when building
+Log4cxx. This feature is also only supported on Linux at the moment.
+Because this feature is non-standard, it may not work properly in all
+circumstances.
+