I apologize if this discussion has been taken up before. I've looked at both the SF mailing list as well as the Apache one and I didn't see this. I'm using log4net-1.2.0-beta8 on .NET Framework v1.1. Here's the question:
Why are class fields in log4net specified with different access modifiers than those same fields in log4j? An example: In the PatternParser class in log4j there are no private instance fields (all fields are either marked as protected, or unmarked giving them default package access.) In the same PatternParser class in log4net all these fields are marked as private. I ask because I ran across this while porting a log4j extension to log4net. I can't see any reason why you'd want to do this when you're simply porting an existing framework. Log4net should provide the same extensibility features that log4j provides. Changing the field accesibility levels destroys that feature (or at least makes it more difficult to port extensions for one framework to the other.) I have modified the class in question to reflect a true port of the PatternParser.java class. I'll attach a diff to the bottom of this email if the team is interested in patching this. Is there any reason why the log4net authors did this? Does this "redesign" of the log4j architecture show up anywhere else in the log4net codebase? If so, are the authors interested in fixing this? Thanks in advance, Michael Stricklen Software Engineer Office of the CTO Computer Associates 388a389,430 > #region Protected Instance Fields > /// <summary> > /// the total length of the pattern > /// </summary> > protected int m_patternLength; > > protected int m_state; > > /// <summary> > /// the literal being parsed > /// </summary> > protected StringBuilder m_currentLiteral = new StringBuilder(32) ; > > > > /// <summary> > /// the current index into the pattern > /// </summary> > protected int m_index; > > /// <summary> > /// The first pattern converter in the chain > /// </summary> > protected PatternConverter m_head; > > /// <summary> > /// the last pattern converter in the chain > /// </summary> > protected PatternConverter m_tail; > > /// <summary> > /// the formatting info object > /// </summary> > protected FormattingInfo m_formattingInfo = new FormattingInfo() ; > > /// <summary> > /// The pattern > /// </summary> > protected string m_pattern; > > #endregion Protected Instance Fields > 439,478d480 < #region Private Instance Fields < < private int m_state; < < /// <summary> < /// the literal being parsed < /// </summary> < private StringBuilder m_currentLiteral = new StringBuilder(32); < < /// <summary> < /// the total length of the pattern < /// </summary> < private int m_patternLength; < < /// <summary> < /// the current index into the pattern < /// </summary> < private int m_index; < < /// <summary> < /// The first pattern converter in the chain < /// </summary> < private PatternConverter m_head; < < /// <summary> < /// the last pattern converter in the chain < /// </summary> < private PatternConverter m_tail; < < /// <summary> < /// the formatting info object < /// </summary> < private FormattingInfo m_formattingInfo = new FormattingInfo(); < < /// <summary> < /// The pattern < /// </summary> < private string m_pattern; < < #endregion Private Instance Fields
