Browse Source

Minor logging improvements

Tal Aloni 7 years ago
parent
commit
eb816a6aaf

+ 1 - 0
SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.Set.cs

@@ -67,6 +67,7 @@ namespace SMBLibrary
                         m_fileSystem.Delete(destination);
                     }
                     m_fileSystem.Move(fileHandle.Path, destination);
+                    Log(Severity.Information, "SetFileInformation: Renamed '{0}' to '{1}'", fileHandle.Path, destination);
                 }
                 catch (Exception ex)
                 {

+ 1 - 1
SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs

@@ -85,7 +85,7 @@ namespace SMBLibrary
                 if (entry != null)
                 {
                     // File already exists, fail the request
-                    Log(Severity.Verbose, "CreateFile: File '{0}' already exist", path);
+                    Log(Severity.Verbose, "CreateFile: File '{0}' already exists.", path);
                     fileStatus = FileStatus.FILE_EXISTS;
                     return NTStatus.STATUS_OBJECT_NAME_COLLISION;
                 }

+ 1 - 1
SMBLibrary/Server/SMB1/NTCreateHelper.cs

@@ -42,7 +42,7 @@ namespace SMBLibrary.Server.SMB1
             NTStatus createStatus = share.FileStore.CreateFile(out handle, out fileStatus, path, request.DesiredAccess, request.ShareAccess, request.CreateDisposition, request.CreateOptions, session.SecurityContext);
             if (createStatus != NTStatus.STATUS_SUCCESS)
             {
-                state.LogToServer(Severity.Verbose, "Create: Opening '{0}{1}' failed. NTStatus: '{2}'.", share.Name, path, createStatus);
+                state.LogToServer(Severity.Verbose, "Create: Opening '{0}{1}' failed. NTStatus: {2}.", share.Name, path, createStatus);
                 header.Status = createStatus;
                 return new ErrorResponse(request.CommandName);
             }

+ 1 - 1
SMBLibrary/Server/SMB1/OpenAndXHelper.cs

@@ -59,7 +59,7 @@ namespace SMBLibrary.Server.SMB1
             header.Status = share.FileStore.CreateFile(out handle, out fileStatus, path, desiredAccess, shareAccess, createDisposition, createOptions, session.SecurityContext);
             if (header.Status != NTStatus.STATUS_SUCCESS)
             {
-                state.LogToServer(Severity.Verbose, "OpenAndX: Opening '{0}{1}' failed. NTStatus: '{2}'.", share.Name, path, header.Status);
+                state.LogToServer(Severity.Verbose, "OpenAndX: Opening '{0}{1}' failed. NTStatus: {2}.", share.Name, path, header.Status);
                 return new ErrorResponse(request.CommandName);
             }
 

+ 1 - 1
SMBLibrary/Server/SMB2/CreateHelper.cs

@@ -38,7 +38,7 @@ namespace SMBLibrary.Server.SMB2
             NTStatus createStatus = share.FileStore.CreateFile(out handle, out fileStatus, path, request.DesiredAccess, request.ShareAccess, request.CreateDisposition, request.CreateOptions, session.SecurityContext);
             if (createStatus != NTStatus.STATUS_SUCCESS)
             {
-                state.LogToServer(Severity.Verbose, "Create: Opening '{0}{1}' failed. NTStatus: '{2}'.", share.Name, path, createStatus);
+                state.LogToServer(Severity.Verbose, "Create: Opening '{0}{1}' failed. NTStatus: {2}.", share.Name, path, createStatus);
                 return new ErrorResponse(request.CommandName, createStatus);
             }