Permalink
Browse files

Logging user name when installing/uninstalling a package

  • Loading branch information...
napernik committed Jul 2, 2018
1 parent 0947337 commit 53744fac4b73f1655e44eb17194292bcfbfa6fba
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -8,6 +8,7 @@
using System.ComponentModel;
using System.Text;
using System.Xml.Linq;
using Composite.C1Console.Security;
using Composite.Core.Application;
@@ -223,7 +224,9 @@ public List<PackageFragmentValidationResult> Install()
if (_validationResult.Count > 0) throw new InvalidOperationException("Installation did not validate");
Verify.IsNull(_installationResult, "Install may only be called once");
Log.LogInformation(LogTitle, "Installing package: {0}, Version: {1}, Id = {2}", _packageName, _packageVersion, _packageId);
var userName = UserValidationFacade.IsLoggedIn() ? UserValidationFacade.GetUsername() : "<system>";
Log.LogInformation(LogTitle, $"Installing package: {_packageName}, Version: {_packageVersion}, Id = {_packageId}; User name: '{userName}'");
PackageFragmentValidationResult result = _packageInstaller.Install(_systemLockingType);
@@ -1,8 +1,9 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Composite.C1Console.Security;
using Composite.Core.Application;
using Composite.Core.IO;
using Composite.Core.IO.Zip;
@@ -139,8 +140,8 @@ private void DoUninstall()
private void DoUninstallWithoutTransaction()
{
Log.LogInformation(LogTitle, "Uninstalling package '{0}', Id = {1}", PackageInformation.Name, PackageInformation.Id);
var userName = UserValidationFacade.IsLoggedIn() ? UserValidationFacade.GetUsername() : "<system>";
Log.LogInformation(LogTitle, $"Uninstalling package '{PackageInformation.Name}', Id = {PackageInformation.Id}. User name: '{userName}'");
try
{

0 comments on commit 53744fa

Please sign in to comment.