Fixed audit log message overflow

This commit is contained in:
anhefti 2021-12-13 15:42:10 +01:00
parent bf3f11147f
commit ad44ea6fe0

View file

@ -44,6 +44,7 @@ import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
import ch.ethz.seb.sebserver.gbl.model.user.UserLogActivityType; import ch.ethz.seb.sebserver.gbl.model.user.UserLogActivityType;
import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile;
import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Result;
import ch.ethz.seb.sebserver.gbl.util.Utils;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.InstitutionRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.InstitutionRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordDynamicSqlSupport;
import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.UserActivityLogRecordMapper;
@ -538,6 +539,10 @@ public class UserActivityLogDAOImpl implements UserActivityLogDAO {
} catch (final JsonProcessingException e) { } catch (final JsonProcessingException e) {
entityAsString = entity.toString(); entityAsString = entity.toString();
} }
if (entityAsString != null && entityAsString.length() > 4000) {
return Utils.truncateText(entityAsString, 4000);
}
return entityAsString; return entityAsString;
} }