mirror of
https://github.com/oqtane/oqtane.framework.git
synced 2025-05-29 16:23:05 +00:00
Merge pull request #4568 from sbwalker/dev
fix #4559 - prevednt Log fields from exceeding column length
This commit is contained in:
commit
c77ded51a9
@ -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…
x
Reference in New Issue
Block a user