Skip to content

Commit 556d2c3

Browse files
committed
clean up of log messages
Signed-off-by: Neil South <[email protected]>
1 parent dab25f2 commit 556d2c3

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Configuration/ConfigurationValidator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private bool IsValidDirectory(string source, string directory)
120120
private bool IsValidBucketName(string source, string bucketName)
121121
{
122122
var valid = IsNotNullOrWhiteSpace(source, bucketName);
123-
var regex = new Regex("(?=^.{3,63}$)(^[a-z0-9]+[a-z0-9\\-]+[a-z0-9]+$)");
123+
var regex = new Regex("(?=^.{3,63}$)(^[a-z0-9]+[a-z0-9\\-]+[a-z0-9]+$)", new RegexOptions(), TimeSpan.FromSeconds(5));
124124
if (!regex.IsMatch(bucketName))
125125
{
126126
valid = false;

src/InformaticsGateway/Logging/Log.4000.ObjectUploadService.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ public static partial class Log
2727
[LoggerMessage(EventId = 4001, Level = LogLevel.Debug, Message = "Upload statistics: {threads} threads, {seconds} seconds.")]
2828
public static partial void UploadStats(this ILogger logger, int threads, double seconds);
2929

30-
[LoggerMessage(EventId = 4002, Level = LogLevel.Debug, Message = "Uploading file to temporary store at {filePath}.")]
31-
public static partial void UploadingFileToTemporaryStore(this ILogger logger, string filePath);
30+
[LoggerMessage(EventId = 4002, Level = LogLevel.Debug, Message = "Uploading file to storeage at {filePath}.")]
31+
public static partial void UploadingFileToStoreage(this ILogger logger, string filePath);
3232

3333
[LoggerMessage(EventId = 4003, Level = LogLevel.Information, Message = "Instance queued for upload {identifier}. Items in queue {count} using memory {memoryUsageKb}KB.")]
3434
public static partial void InstanceAddedToUploadQueue(this ILogger logger, string identifier, int count, double memoryUsageKb);
3535

3636
[LoggerMessage(EventId = 4004, Level = LogLevel.Debug, Message = "Error removing objects that are pending upload during startup.")]
3737
public static partial void ErrorRemovingPendingUploadObjects(this ILogger logger, Exception ex);
3838

39-
[LoggerMessage(EventId = 4005, Level = LogLevel.Error, Message = "Error uploading temporary store. Waiting {timeSpan} before next retry. Retry attempt {retryCount}.")]
39+
[LoggerMessage(EventId = 4005, Level = LogLevel.Error, Message = "Error uploading storeage. Waiting {timeSpan} before next retry. Retry attempt {retryCount}.")]
4040
public static partial void ErrorUploadingFileToTemporaryStore(this ILogger logger, TimeSpan timespan, int retryCount, Exception ex);
4141

42-
[LoggerMessage(EventId = 4006, Level = LogLevel.Information, Message = "File uploaded to temporary store at {filePath}.")]
43-
public static partial void UploadedFileToTemporaryStore(this ILogger logger, string filePath);
42+
[LoggerMessage(EventId = 4006, Level = LogLevel.Information, Message = "File uploaded to storeage at {filePath}.")]
43+
public static partial void UploadedFileToStoreage(this ILogger logger, string filePath);
4444

4545
[LoggerMessage(EventId = 4007, Level = LogLevel.Debug, Message = "Items in queue {count}.")]
4646
public static partial void InstanceInUploadQueue(this ILogger logger, int count);

src/InformaticsGateway/Services/Storage/ObjectUploadService.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ private async Task<bool> VerifyExists(string path, CancellationToken cancellatio
225225

226226
private async Task UploadFile(StorageObjectMetadata storageObjectMetadata, string source, List<string> workflows, string payloadId, CancellationToken cancellationToken)
227227
{
228-
_logger.UploadingFileToTemporaryStore(storageObjectMetadata.TemporaryPath);
228+
_logger.UploadingFileToStoreage(storageObjectMetadata.TemporaryPath);
229229
var metadata = new Dictionary<string, string>
230230
{
231231
{ FileMetadataKeys.Source, source },
@@ -257,7 +257,7 @@ await _storageService.PutObjectAsync(
257257
metadata,
258258
cancellationToken).ConfigureAwait(false);
259259
storageObjectMetadata.SetUploaded(_configuration.Value.Storage.TemporaryStorageBucket); // deletes local file and sets uploaded to true
260-
_logger.UploadedFileToTemporaryStore(storageObjectMetadata.TemporaryPath);
260+
_logger.UploadedFileToStoreage(storageObjectMetadata.TemporaryPath);
261261
storageObjectMetadata.SetMoved(_configuration.Value.Storage.StorageServiceBucketName); // set bucket, date moved, and move complete
262262
})
263263
.ConfigureAwait(false);

0 commit comments

Comments
 (0)