title: C# private, static, and readonly
body: <p>I was reviewing some code for log4net and I came across this.</p>
  
  <pre><code>private static readonly ILog logger = LogManager.GetLogger(typeof(AdminClient));
  </code></pre>
  
  <p>I am wondering why would you need to have private static readonly.</p>
  
  <p>From my understanding private would mean that the variable cannot not be used outside the class unless there is a accessor method or get property.</p>
  
  <p>static would mean that the variable is scoped only in this file only.</p>
  
  <p>readonly would mean that you can only read from the value and cannot assign it.</p>
  
  <p>So, I am thinking that the person who wrote this code. declared it private as they don't want it used outside the class and static so that don't want it used outside the file. However, if there is a get property would static prevent this form happening. </p>
  
  <p>I think I can understand readonly and the value is only to be read from and not set.</p>
  
  <p>Many thanks for any advice,</p>