added logging.
This commit is contained in:
@@ -13,9 +13,11 @@ namespace CarCareTracker.Helper
|
|||||||
public class FileHelper : IFileHelper
|
public class FileHelper : IFileHelper
|
||||||
{
|
{
|
||||||
private readonly IWebHostEnvironment _webEnv;
|
private readonly IWebHostEnvironment _webEnv;
|
||||||
public FileHelper(IWebHostEnvironment webEnv)
|
private readonly ILogger<IFileHelper> _logger;
|
||||||
|
public FileHelper(IWebHostEnvironment webEnv, ILogger<IFileHelper> logger)
|
||||||
{
|
{
|
||||||
_webEnv = webEnv;
|
_webEnv = webEnv;
|
||||||
|
_logger = logger;
|
||||||
}
|
}
|
||||||
public string GetFullFilePath(string currentFilePath, bool mustExist = true)
|
public string GetFullFilePath(string currentFilePath, bool mustExist = true)
|
||||||
{
|
{
|
||||||
@@ -90,6 +92,7 @@ namespace CarCareTracker.Helper
|
|||||||
return true;
|
return true;
|
||||||
} catch (Exception ex)
|
} catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
_logger.LogError(ex, $"Error Restoring Database Backup: {ex.Message}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user