diff --git a/Oqtane.Server/Repository/LogRepository.cs b/Oqtane.Server/Repository/LogRepository.cs index 313c9881..12f43a21 100644 --- a/Oqtane.Server/Repository/LogRepository.cs +++ b/Oqtane.Server/Repository/LogRepository.cs @@ -48,6 +48,12 @@ namespace Oqtane.Repository public void AddLog(Log log) { + if (log.Url.Length > 2048) log.Url = log.Url.Substring(0, 2048); + if (log.Server.Length > 200) log.Server = log.Server.Substring(0, 200); + if (log.Category.Length > 200) log.Category = log.Category.Substring(0, 200); + if (log.Feature.Length > 200) log.Feature = log.Feature.Substring(0, 200); + if (log.Function.Length > 20) log.Function = log.Function.Substring(0, 20); + if (log.Level.Length > 20) log.Level = log.Level.Substring(0, 20); using var db = _dbContextFactory.CreateDbContext(); db.Log.Add(log); db.SaveChanges();