prevent recursive logging csharp stackoverflow. (#59503)

* prevent recursive logging situation.

* Add changelog

(cherry picked from commit 6a5cd9a820)
pull/60332/head
Manu Lange 6 years ago committed by Toshio Kuratomi
parent a0afc2d656
commit 8e56708e22

@ -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