Protected loggers do not log the class where the method is correctly.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-05-11 15:10:14 +01:00
parent 82ed9b19d3
commit 2909a4996d
17 changed files with 31 additions and 9 deletions

View File

@ -49,7 +49,7 @@ namespace XenAdmin.Controls.CheckableDataGridView
public bool RefreshGrid { get; set; }
}
protected static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private const string RowUpdatedEventKey = "CheckableDataGridViewRowUpdatedEventKey";
private const string RowCheckedEventKey = "CheckableDataGridViewRowCheckedEventKey";

View File

@ -47,7 +47,7 @@ namespace XenAdmin.Controls
private VNCView activeVNCView;
private Dictionary<VM, VNCView> vncViews = new Dictionary<VM, VNCView>();
protected static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public ConsolePanel()
{
@ -287,6 +287,8 @@ namespace XenAdmin.Controls
internal class CvmConsolePanel : ConsolePanel
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
internal override void SetCurrentSource(Host source)
{
if (source == null)

View File

@ -43,8 +43,7 @@ namespace XenAdmin.Wizards.BugToolWizard
{
public partial class BugToolPageDestination : XenTabPage
{
private static readonly log4net.ILog Log =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()?.DeclaringType);
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()?.DeclaringType);
private bool _buttonNextEnabled;

View File

@ -56,7 +56,7 @@ namespace XenAdmin.Wizards.PatchingWizard
private bool _userMovedVerticalScrollbar;
private bool _cancelEnabled;
protected static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()?.DeclaringType);
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()?.DeclaringType);
protected List<string> HostsThatWillRequireReboot = new List<string>();
protected Dictionary<string, List<string>> LivePatchAttempts = new Dictionary<string, List<string>>();
protected bool ThisPageIsCompleted;

View File

@ -44,8 +44,7 @@ namespace XenAdmin.Wizards.PatchingWizard
{
public partial class PatchingWizard_SelectPatchPage : XenTabPage
{
private static readonly log4net.ILog log =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public XenServerPatchAlert AlertFromFileOnDisk;
public bool FileFromDiskHasUpdateXml { get; private set; }

View File

@ -39,6 +39,8 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
public class ApplyXenServerPatchPlanAction : HostPlanAction
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly XenServerPatch xenServerPatch;
private readonly List<HostUpdateMapping> mappings;

View File

@ -38,6 +38,8 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
public abstract class HostPlanAction : PlanActionWithSession
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly Host _currentHost;
protected readonly XenRef<Host> HostXenRef;

View File

@ -42,6 +42,8 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
class PatchPrecheckOnHostPlanAction : PlanActionWithSession
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly XenServerPatch xenServerPatch;
private readonly List<HostUpdateMapping> mappings;
private readonly Host host;

View File

@ -40,7 +40,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
public abstract class PlanAction : IEquatable<PlanAction>
{
protected static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private int _percentComplete;
public event Action<PlanAction> OnProgressChange;

View File

@ -37,6 +37,8 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
public abstract class RebootPlanAction : HostPlanAction
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private bool _cancelled;
private bool _lostConnection;
private readonly object _lockObj = new object();

View File

@ -39,6 +39,8 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
class RemoveUpdateFileFromCoordinatorPlanAction : PlanActionWithSession
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly List<HostUpdateMapping> patchMappings = new List<HostUpdateMapping>();
private readonly XenServerPatch xenServerPatch;
private readonly Host coordinator;

View File

@ -44,6 +44,8 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
{
class UploadPatchToCoordinatorPlanAction : PlanActionWithSession
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly XenServerPatch xenServerPatch;
private readonly List<HostUpdateMapping> mappings;
private Dictionary<XenServerPatch, string> AllDownloadedPatches = new Dictionary<XenServerPatch, string>();

View File

@ -46,6 +46,8 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard.PlanActions
{
class RpuUploadAndApplySuppPackPlanAction : HostPlanAction
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Host host;
private List<Host> hosts;
private string suppPackPath;

View File

@ -39,6 +39,8 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard.PlanActions
{
public class UpgradeAutomatedHostPlanAction : UpgradeHostPlanAction
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly Dictionary<string, string> _arguments;
public UpgradeAutomatedHostPlanAction(Host host, Control invokingControl, Dictionary<string, string> arguments)

View File

@ -42,6 +42,8 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard.PlanActions
{
public abstract class UpgradeHostPlanAction : RebootPlanAction
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected bool rebooting;
private readonly Timer timer;
protected readonly Control invokingControl;

View File

@ -41,6 +41,8 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard
{
public partial class RollingUpgradeUpgradePage : AutomatedUpdatesBasePage
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public RollingUpgradeUpgradePage()
{
InitializeComponent();

View File

@ -214,6 +214,8 @@ namespace XenOvf
/// </summary>
internal class TarPackage : Package
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly Dictionary<string, byte[]> _DirectoryCache = new Dictionary<string, byte[]>();
private string _DescriptorFileName;
@ -424,7 +426,7 @@ namespace XenOvf
/// </summary>
public abstract class Package
{
protected static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public const string MANIFEST_EXT = ".mf";
public const string CERTIFICATE_EXT = ".cert";