prevent recursive logging csharp stackoverflow. (#59503)

* prevent recursive logging situation.

* Add changelog
pull/60257/head
Manu Lange 5 years ago committed by Jordan Borean
parent 2cae0739e9
commit 6a5cd9a820

@ -0,0 +1,2 @@
bugfixes:
- ansible.basics - fix core C# recursive call when logging fails (e.g. if insufficient permissions are held) (https://github.com/ansible/ansible/pull/59503)

@ -304,7 +304,8 @@ namespace Ansible.Basic
}
catch (System.Security.SecurityException)
{
Warn(String.Format("Access error when creating EventLog source {0}, logging to the Application source instead", logSource));
// Cannot call Warn as that calls LogEvent and we get stuck in a loop
warnings.Add(String.Format("Access error when creating EventLog source {0}, logging to the Application source instead", logSource));
logSource = "Application";
}
}

Loading…
Cancel
Save