Github user jbaehr commented on a diff in the pull request:
https://github.com/apache/logging-log4net/pull/16#discussion_r134177639
--- Diff: src/Appender/FileAppender.cs ---
@@ -371,21 +371,22 @@ public abstract class LockingModelBase
{
private FileAppender m_appender = null;
- /// <summary>
- /// Open the output file
- /// </summary>
- /// <param name="filename">The filename to use</param>
- /// <param name="append">Whether to append to the file,
or overwrite</param>
- /// <param name="encoding">The encoding to use</param>
- /// <remarks>
- /// <para>
- /// Open the file specified and prepare for logging.
- /// No writes will be made until <see
cref="AcquireLock"/> is called.
- /// Must be called before any calls to <see
cref="AcquireLock"/>,
- /// <see cref="ReleaseLock"/> and <see
cref="CloseFile"/>.
- /// </para>
- /// </remarks>
- public abstract void OpenFile(string filename, bool
append, Encoding encoding);
+ /// <summary>
+ /// Open the output file
+ /// </summary>
+ /// <param name="filename">The filename to use</param>
+ /// <param name="append">Whether to append to the file, or
overwrite</param>
+ /// <param name="encoding">The encoding to use</param>
+ /// <param name="useMutexWithMinimalLock">Whether to protect
append operation in Minimal lock with Mutex </param>
+ /// <remarks>
+ /// <para>
+ /// Open the file specified and prepare for logging.
+ /// No writes will be made until <see cref="AcquireLock"/> is
called.
+ /// Must be called before any calls to <see
cref="AcquireLock"/>,
+ /// <see cref="ReleaseLock"/> and <see cref="CloseFile"/>.
+ /// </para>
+ /// </remarks>
+ public abstract void OpenFile(string filename, bool append,
Encoding encoding, bool useMutexWithMinimalLock = false);
--- End diff --
Please do not change the public API of the locking model. This would make
all locking model implementations out there incompatible with the next log4net
release. Prefer a new locking model instead.
A basic idea of the strategy pattern for the locking model is that the
class using the strategy (`FileAppender`, in our case) does not require any
knowledge about a specific strategy. With the new setting
`MutexWithMinimalLock` however, such a locking model specific knowledge is
introduced. And it requires changes to all other implementations as well.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---