fix #4559 - prevednt Log fields from exceeding column length
This commit is contained in:
parent
197d5ca1f2
commit
59bd9fdc22
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user