Seeder güncellemeleri

LogWarning, LogError, LogError
This commit is contained in:
Sedat Öztürk 2026-05-26 12:29:46 +03:00
parent df575706fb
commit bea5aabffa
20 changed files with 72 additions and 73 deletions

View file

@ -17,15 +17,15 @@ public class RocketSender : ISozsoftRocketSender
public async Task<RocketSendResult> SendAsync(string Username, string Message)
{
logger.LogInformation("Rocket gönderiliyor. {Username}, {Message}", Username, Message);
logger.LogInformation("Sending Rocket message. {Username}, {Message}", Username, Message);
var result = await httpClient.SendMessageAsync(Username, Message);
if (result.Success)
{
logger.LogInformation("Rocket gönderildi. {Username}, {Message}", Username, Message);
logger.LogInformation("Rocket sent successfully. {Username}, {Message}", Username, Message);
}
else
{
logger.LogWarning("Rocket gönderilemedi. {Username}, {Message}", Username, Message);
logger.LogWarning("Failed to send Rocket message. {Username}, {Message}", Username, Message);
}
return new RocketSendResult

View file

@ -25,15 +25,15 @@ public class PostaGuverciniSmsSender : ISozsoftSmsSender
Message = Check.NotNullOrWhiteSpace(Message, nameof(Message));
PhoneNumber = PhoneNumber.StartsWith('0') ? PhoneNumber[1..] : PhoneNumber;
logger.LogInformation("Sms gönderiliyor. {PhoneNumber}, {Message}", PhoneNumber, Message);
logger.LogInformation("Sending SMS message. {PhoneNumber}, {Message}", PhoneNumber, Message);
var result = await httpClient.SendSmsAsync(PhoneNumber, Message);
if (result.IsSuccess)
{
logger.LogInformation("Sms gönderildi. {PhoneNumber}, {Message}", PhoneNumber, Message);
logger.LogInformation("SMS sent successfully. {PhoneNumber}, {Message}", PhoneNumber, Message);
}
else
{
logger.LogWarning("Sms gönderilemedi. {PhoneNumber}, {Message}, {Error}", PhoneNumber, Message, $"{result.ErrNo}:{result.ErrText}");
logger.LogWarning("Failed to send SMS message. {PhoneNumber}, {Message}, {Error}", PhoneNumber, Message, $"{result.ErrNo}:{result.ErrText}");
}
return new SmsSendResult

View file

@ -23,16 +23,16 @@ public class SozsoftWhatsAppSender : ISozsoftWhatsAppSender
public async Task<WhatsAppSendResult> SendAsync(string To, string Message, string LanguageCode = "tr")
{
logger.LogInformation("WhatsApp gönderiliyor. {To}, {LanguageCode}, {Message}", To, LanguageCode, Message);
logger.LogInformation("Sending WhatsApp message. {To}, {LanguageCode}, {Message}", To, LanguageCode, Message);
var result = await httpClient.SendMessageAsync(To, Message, LanguageCode);
var success = !result.messages.IsNullOrEmpty() && result.messages.FirstOrDefault()?.message_status == "accepted";
if (success)
{
logger.LogInformation("WhatsApp gönderildi. {To}, {LanguageCode}, {Message}", To, LanguageCode, Message);
logger.LogInformation("WhatsApp sent successfully. {To}, {LanguageCode}, {Message}", To, LanguageCode, Message);
}
else
{
logger.LogWarning("WhatsApp gönderilemedi. {To}, {LanguageCode}, {Message}", To, LanguageCode, Message);
logger.LogWarning("Failed to send WhatsApp message. {To}, {LanguageCode}, {Message}", To, LanguageCode, Message);
}
return new WhatsAppSendResult

View file

@ -35,7 +35,7 @@ public class BackgroundWorkerInitializer : ITransientDependency
var turkeyTimeZone = GetTurkeyTimeZone();
_logger.LogInformation(
"Background workers Türkiye saat dilimine göre kuruluyor. TimeZoneId: {TimeZoneId}",
"Background Works is set up according to the Turkish time zone. TimeZoneId: {TimeZoneId}",
turkeyTimeZone.Id);
var jobs = JobStorage.Current.GetConnection().GetRecurringJobs();

View file

@ -70,14 +70,14 @@ public class CustomEndpointAppService : PlatformAppService
.EnsureStartsWith('/')
.EnsureEndsWith('/');
Logger.LogInformation("Custom Endpoint çağrısı. Kullanıcı:{user} Path:[{method}]{path}", CurrentUser.UserName, "GET", path);
Logger.LogInformation("Custom Endpoint called. User: {user} Path: [{method}]{path}", CurrentUser.UserName, "GET", path);
var api = await repo.FirstOrDefaultAsync(a => path.StartsWith(a.Url) && a.Method == method);
if (api is null)
{
Logger.LogInformation("Custom Endpoint bulunamadı");
Logger.LogInformation("Custom Endpoint not found: {path}", path);
return new NotFoundResult();
}
Logger.LogInformation("Custom Endpoint bulundu. {api}", api.Name);
Logger.LogInformation("Custom Endpoint found: {api}", api.Name);
var canUse = api.Permissions.Any(a =>
(a.ResourceType == "User" && a.ResourceId == CurrentUser.UserName) ||
@ -85,7 +85,7 @@ public class CustomEndpointAppService : PlatformAppService
(a.ResourceType == "Global"));
if (!canUse)
{
Logger.LogWarning("Custom Endpoint yetki yok");
Logger.LogWarning("Custom Endpoint has no permission: {path}", path);
return new UnauthorizedResult();
}
@ -158,13 +158,12 @@ public class CustomEndpointAppService : PlatformAppService
}
}
Logger.LogInformation("Parametreler: {param}", param);
Logger.LogInformation("Parameters: {param}", param);
var (dynamicDataRepository, connectionString, _) = await dynamicDataManager.GetAsync(api.DataSourceCode == "!Tenant", api.DataSourceCode);
var result = await dynamicDataRepository.QueryAsync(api.Sql, connectionString, param);
Logger.LogInformation("Sonuç başarılı");
Logger.LogInformation("{result}", result);
Logger.LogInformation("Query successful. Result: {result}", result);
await uow.CompleteAsync();

View file

@ -36,7 +36,7 @@ public class DynamicAppServiceAppService : PlatformAppService, IDynamicServiceAp
}
catch (Exception ex)
{
Logger.LogError(ex, "Test compile sırasında hata. Tenant: {TenantId}", CurrentTenant.Id);
Logger.LogError(ex, "Failed to test compile dynamic service. Tenant: {TenantId}", CurrentTenant.Id);
throw;
}
}
@ -152,13 +152,13 @@ public class DynamicAppServiceAppService : PlatformAppService, IDynamicServiceAp
}
catch (Exception ex)
{
Logger.LogError(ex, "AppService yayınlama sırasında hata. Ad: {Name}, Tenant: {TenantId}",
Logger.LogError(ex, "Failed to publish dynamic service. Name: {Name}, Tenant: {TenantId}",
request.Name, CurrentTenant.Id);
return new PublishResultDto
{
Success = false,
ErrorMessage = $"Yayınlama sırasında beklenmeyen hata: {ex.Message}"
ErrorMessage = $"Failed to publish dynamic service: {ex.Message}"
};
}
}
@ -233,7 +233,7 @@ public class DynamicAppServiceAppService : PlatformAppService, IDynamicServiceAp
if (!result.Success)
{
Logger.LogWarning(
"Servis aktif edildi ancak yeniden derleme başarısız. Ad: {Name}, Hata: {Error}",
"Failed to recompile and register dynamic service. Name: {Name}, Error: {Error}",
appService.Name, result.ErrorMessage);
}
}
@ -274,7 +274,7 @@ public class DynamicAppServiceAppService : PlatformAppService, IDynamicServiceAp
catch (Exception ex)
{
errorCount++;
Logger.LogError(ex, "AppService yeniden yükleme hatası. ID: {Id}", service.Id);
Logger.LogError(ex, "Failed to recompile dynamic service. ID: {Id}", service.Id);
service.MarkCompilationError(ex.Message);
await _dynamicAppServiceRepository.UpdateAsync(service);

View file

@ -139,7 +139,7 @@ public class DynamicServiceCompiler : ITransientDependency
result.ErrorMessage = $"Derleme {result.Errors.Count} hata ile başarısız oldu.";
}
_logger.LogInformation("Kod derlemesi tamamlandı. Başarılı: {Success}, Süre: {Time}ms, Hata sayısı: {ErrorCount}",
_logger.LogInformation("Compilation completed. Success: {Success}, Time: {Time}ms, Error Count: {ErrorCount}",
result.Success, stopwatch.ElapsedMilliseconds, result.Errors?.Count ?? 0);
return result;
@ -147,7 +147,7 @@ public class DynamicServiceCompiler : ITransientDependency
catch (Exception ex)
{
stopwatch.Stop();
_logger.LogError(ex, "Kod derlemesi sırasında beklenmeyen hata");
_logger.LogError(ex, "Compilation failed with unexpected error");
return new CompileResultDto
{
@ -211,12 +211,12 @@ public class DynamicServiceCompiler : ITransientDependency
}
catch (Exception ex)
{
_logger.LogError(ex, "Assembly yükleme sırasında hata. Tenant: {TenantId}", tenantId);
_logger.LogError(ex, "Failed to load assembly. Tenant: {TenantId}", tenantId);
return new CompileResultDto
{
Success = false,
ErrorMessage = $"Assembly yükleme hatası: {ex.Message}",
ErrorMessage = $"Failed to load assembly: {ex.Message}",
Errors = new List<CompilationErrorDto>()
};
}
@ -317,7 +317,7 @@ public class DynamicServiceCompiler : ITransientDependency
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Assembly referansı eklenemedi: {Assembly}", assembly.FullName);
_logger.LogWarning(ex, "Failed to add assembly reference: {Assembly}", assembly.FullName);
}
}

View file

@ -377,12 +377,12 @@ public class ListFormWizardAppService(
var filePath = Path.Combine(outputPath, $"{timestamp}_{safeWizardName}.json");
await File.WriteAllTextAsync(filePath, json);
logger.LogInformation($"Seed dosyası kaydedildi: {filePath}");
logger.LogInformation($"Seed file saved: {filePath}");
}
catch (Exception ex)
{
// Dosya kaydetme hatası wizard işlemini engellemez
logger.LogError(ex, $"Seed dosyası kaydedilemedi: {ex.Message}");
logger.LogError(ex, $"Seed file could not be saved: {ex.Message}");
}
}

View file

@ -22,8 +22,8 @@ public class TestAppService : PlatformAppService
{
public dynamic GetTest()
{
Logger.LogWarning("{0} adet kayıt ok.", 3);
Logger.LogWarning(3 + " adet kayıt ok.");
Logger.LogWarning("Sending test message. {Count}", 3);
Logger.LogWarning("Sending test message. {Count} adet kayıt ok.", 3);
throw new UserFriendlyException("Toplam 1000'i geçemez");
//throw new System.Exception("Toplam 1000'i geçemez");

View file

@ -64,7 +64,7 @@ public class HangfireDbSchemaMigrator : IPlatformDbSchemaMigrator, ITransientDep
}
catch (Exception ex)
{
_logger.LogError(ex, "HangFire schema initialization FAILED.");
_logger.LogError(ex, "HangFire schema initialization failed.");
throw;
}
}

View file

@ -120,7 +120,7 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
}
catch (Exception ex)
{
_logger.LogError(ex, $"Hata - {filePath}: {ex.Message}");
_logger.LogError(ex, $"Error - {filePath}: {ex.Message}");
}
}
}

View file

@ -92,9 +92,9 @@ public class PlatformBackgroundWorker : PlatformDomainService, IPlatformBackgrou
// Call BeforeSp
if (!Worker.BeforeSp.IsNullOrWhiteSpace())
{
Logger.LogInformation(LogPrefix, $"BeforeSP çalıştırılıyor");
Logger.LogInformation(LogPrefix, $"BeforeSP running");
var result = await SpRepository.CallSpAsync(Worker.BeforeSp, Worker.DataSourceCode, null);
Logger.LogInformation(LogPrefix, $"BeforeSP çalıştırıldı. Sonuç: {result}");
Logger.LogInformation(LogPrefix, $"BeforeSP completed. Result: {result}");
}
//Do work
@ -122,9 +122,9 @@ public class PlatformBackgroundWorker : PlatformDomainService, IPlatformBackgrou
// Call AfterSp
if (!Worker.AfterSp.IsNullOrWhiteSpace())
{
Logger.LogInformation(LogPrefix, $"AfterSp çalıştırılıyor");
Logger.LogInformation(LogPrefix, $"AfterSp running");
var result = await SpRepository.CallSpAsync(Worker.AfterSp, Worker.DataSourceCode, null);
Logger.LogInformation(LogPrefix, $"AfterSp çalıştırıldı. Sonuç: {result}");
Logger.LogInformation(LogPrefix, $"AfterSp completed. Result: {result}");
}
}
catch (Exception ex)

View file

@ -95,12 +95,12 @@ public class SetupController : ControllerBase
}
else
{
await Send("error", $"Migrator yolu bulunamadı veya geçersiz: {migratorPath}");
await Send("done", "Hata ile sonlandı.");
await Send("error", $"Migrator path not found or invalid: {migratorPath}");
await Send("done", "Failed.");
return;
}
await Send("info", $"Çalıştırılıyor: {fileName} {arguments}");
await Send("info", $"Running: {fileName} {arguments}");
Process? process = null;
try
@ -142,23 +142,23 @@ public class SetupController : ControllerBase
if (process.ExitCode == 0)
{
await Send("success", "Migration ve seed başarıyla tamamlandı.");
await Send("done", "Tamamlandı.");
await Send("success", "Migration and seed completed successfully.");
await Send("done", "Completed.");
}
else
{
await Send("error", $"Migration başarısız. Çıkış kodu: {process.ExitCode}");
await Send("done", "Hata ile sonlandı.");
await Send("error", $"Migration failed. Exit code: {process.ExitCode}");
await Send("done", "Failed.");
}
}
catch (OperationCanceledException)
{
await Send("warn", "Migration isteği iptal edildi.");
await Send("warn", "Migration request was canceled.");
}
catch (Exception ex)
{
await Send("error", $"Migration hatası: {ex.Message}");
await Send("done", "Hata ile sonlandı.");
await Send("error", $"Migration failed: {ex.Message}");
await Send("done", "Failed.");
}
finally
{

View file

@ -234,12 +234,12 @@ internal static class SetupAppRunner
}
else
{
await Send("error", $"Migrator yolu bulunamadı veya geçersiz: {migratorPath}");
await Send("done", "Hata ile sonlandı.");
await Send("error", $"Migrator path not found or invalid: {migratorPath}");
await Send("done", "Failed.");
return;
}
await Send("info", $"Çalıştırılıyor: {fileName} {arguments}");
await Send("info", $"Running: {fileName} {arguments}");
Process? process = null;
try
@ -281,26 +281,26 @@ internal static class SetupAppRunner
if (process.ExitCode == 0)
{
await Send("success", "Migration ve seed başarıyla tamamlandı.");
await Send("restart", "Uygulama sunucusu yeniden başlatılıyor...");
await Send("done", "Tamamlandı.");
await Send("success", "Migration and seed completed successfully.");
await Send("restart", "Application server is restarting...");
await Send("done", "Completed.");
_ = Task.Delay(1500).ContinueWith(_ => lifetime.StopApplication());
}
else
{
await Send("error", $"Migration başarısız. Çıkış kodu: {process.ExitCode}");
await Send("done", "Hata ile sonlandı.");
await Send("error", $"Migration failed. Exit code: {process.ExitCode}");
await Send("done", "Failed.");
}
}
catch (OperationCanceledException)
{
await Send("warn", "Migration isteği iptal edildi.");
await Send("warn", "Migration request was canceled.");
}
catch (Exception ex)
{
await Send("error", $"Migration hatası: {ex.Message}");
await Send("done", "Hata ile sonlandı.");
await Send("error", $"Migration failed: {ex.Message}");
await Send("done", "Failed.");
}
finally
{

View file

@ -138,13 +138,13 @@ namespace Sozsoft.Platform.DynamicServices
}
catch (Exception ex)
{
_logger.LogError(ex, "Servis yükleme hatası: {Name}", service.Name);
_logger.LogError(ex, "Failed to load dynamic service: {Name}", service.Name);
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Startup servis yükleme hatası");
_logger.LogError(ex, "Failed to load dynamic services on startup");
}
}
@ -170,7 +170,7 @@ namespace Sozsoft.Platform.DynamicServices
}
catch (Exception ex)
{
_logger.LogError(ex, "Assembly kaydı silme başarısız. Tenant: {TenantId}, Servis: {Service}",
_logger.LogError(ex, "Failed to unregister assembly. Tenant: {TenantId}, Service: {Service}",
request.TenantId, request.ServiceName);
}
}
@ -186,7 +186,7 @@ namespace Sozsoft.Platform.DynamicServices
}
catch (Exception ex)
{
_logger.LogError(ex, "Assembly kaydı başarısız. Tenant: {TenantId}, Assembly: {Assembly}",
_logger.LogError(ex, "Failed to register assembly. Tenant: {TenantId}, Assembly: {Assembly}",
request.TenantId, request.AssemblyName);
}
}
@ -205,7 +205,7 @@ namespace Sozsoft.Platform.DynamicServices
foreach (var part in partsToRemove)
{
_partManager.ApplicationParts.Remove(part);
_logger.LogInformation("ApplicationPart kaldırıldı: {Name}", part.Name);
_logger.LogInformation("Assembly unregistered: {Name}", part.Name);
}
// ConventionalControllerSettings'tan kaldır
@ -226,7 +226,7 @@ namespace Sozsoft.Platform.DynamicServices
_changeProvider.NotifyChanges();
_logger.LogInformation(
"Servis assembly'si başarıyla kaldırıldı: {ServiceName} (Tenant: {TenantId})",
"Assembly unregistered: {ServiceName} (Tenant: {TenantId})",
request.ServiceName, request.TenantId);
}
@ -299,7 +299,7 @@ namespace Sozsoft.Platform.DynamicServices
}
catch (Exception ex)
{
_logger.LogError(ex, "Conventional Controllers eklenirken hata");
_logger.LogError(ex, "Failed to configure MVC for assembly: {Assembly}", request.AssemblyName);
}
try
@ -308,7 +308,7 @@ namespace Sozsoft.Platform.DynamicServices
}
catch (Exception ex)
{
_logger.LogError(ex, "ActionDescriptor notify hatası");
_logger.LogError(ex, "Failed to notify ActionDescriptor changes");
}
await Task.Delay(100);

View file

@ -93,7 +93,7 @@ public class DynamicControllerActivator : IControllerActivator
}
catch (Exception ex)
{
_logger.LogError(ex, "Controller oluşturma hatası: {Type}", controllerType.Name);
_logger.LogError(ex, "Failed to create controller: {Type}", controllerType.Name);
throw;
}
}

View file

@ -72,7 +72,7 @@ public class PlatformSessionCleanupWorker : ISessionCleanupWorker, ITransientDep
await sessionRepo.DeleteAsync(session, cancellationToken: cancellationToken);
logger.LogInformation(
"AbpSessions temizliği: TenantId:{TenantId}, UserId:{UserId}, SignedIn:{SignedIn}, Now:{Now}",
"AbpSessions cleanup: TenantId:{TenantId}, UserId:{UserId}, SignedIn:{SignedIn}, Now:{Now}",
tenantId,
session.UserId,
session.SignedIn,
@ -84,7 +84,7 @@ public class PlatformSessionCleanupWorker : ISessionCleanupWorker, ITransientDep
}
catch (Exception ex)
{
logger.LogError(ex, "AbpSessions temizliği sırasında hata oluştu.");
logger.LogError(ex, "Failed to cleanup AbpSessions.");
}
}
}

View file

@ -57,7 +57,7 @@ public class PlatformSessionRevocationHandler :
await sessionRepo.DeleteAsync(session);
logger.LogInformation(
"AbpSessions temizliği: TenantId:{TenantId}, UserId:{UserId}, SignedIn:{SignedIn}, Now:{Now}",
"AbpSessions cleanup: TenantId:{TenantId}, UserId:{UserId}, SignedIn:{SignedIn}, Now:{Now}",
tenantId,
session.UserId,
session.SignedIn,

View file

@ -271,7 +271,7 @@ Your login code: {twoFactorToken}";
catch (UserFriendlyException) { throw; }
catch (Exception ex)
{
Logger.LogWarning(ex, "AbpSessions yönetiminde hata oluştu. UserId: {UserId}", user.Id);
Logger.LogWarning(ex, "Failed to manage AbpSessions. UserId: {UserId}", user.Id);
}
}
@ -313,7 +313,7 @@ Your login code: {twoFactorToken}";
}
catch (Exception ex)
{
Logger.LogWarning(ex, "Refresh token sonrası IdentitySession oluşturulamadı. UserId: {UserId}", refreshUser.Id);
Logger.LogWarning(ex, "Failed to create IdentitySession after refresh token. UserId: {UserId}", refreshUser.Id);
}
}

View file

@ -129,7 +129,7 @@ function BranchSeedContent({
<Dialog.Footer className="flex justify-end items-center pt-3 border-t mt-4">
<Button variant="solid" onClick={handleRunSeed} loading={isLoading}>
{isLoading ? 'Seed Çalıştırılıyor...' : 'Seed İşlemini Başlat'}
{isLoading ? 'Seed Running...' : 'Start the Seed Process'}
</Button>
</Dialog.Footer>
</>