mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
fix(logging): default to pretty logging [EE-4371] (#7847)
* fix(logging): default to pretty logging EE-4371 * feat(app/logs): prettify stack traces in JSON logs * feat(nomad/logs): prettify JSON logs in log viewer * feat(kubernetes/logs): prettigy JSON logs in log viewers * feat(app/logs): format and color zerolog prettified logs * fix(app/logs): pre-parse logs when they are double serialized Co-authored-by: andres-portainer <andres-portainer@users.noreply.github.com> Co-authored-by: LP B <xAt0mZ@users.noreply.github.com>
This commit is contained in:
parent
ee5600b6af
commit
535a26412f
27 changed files with 935 additions and 279 deletions
|
@ -10,11 +10,12 @@ import {
|
|||
stopContainer,
|
||||
} from '@/react/docker/containers/containers.service';
|
||||
import { ContainerDetailsViewModel, ContainerStatsViewModel, ContainerViewModel } from '../models/container';
|
||||
import { formatLogs } from '../helpers/logHelper';
|
||||
|
||||
angular.module('portainer.docker').factory('ContainerService', ContainerServiceFactory);
|
||||
|
||||
/* @ngInject */
|
||||
function ContainerServiceFactory($q, Container, LogHelper, $timeout, EndpointProvider) {
|
||||
function ContainerServiceFactory($q, Container, $timeout, EndpointProvider) {
|
||||
const service = {
|
||||
killContainer: withEndpointId(killContainer),
|
||||
pauseContainer: withEndpointId(pauseContainer),
|
||||
|
@ -159,7 +160,7 @@ function ContainerServiceFactory($q, Container, LogHelper, $timeout, EndpointPro
|
|||
|
||||
Container.logs(parameters)
|
||||
.$promise.then(function success(data) {
|
||||
var logs = LogHelper.formatLogs(data.logs, { stripHeaders, withTimestamps: !!timestamps });
|
||||
var logs = formatLogs(data.logs, { stripHeaders, withTimestamps: !!timestamps });
|
||||
deferred.resolve(logs);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
import { formatLogs } from '../helpers/logHelper';
|
||||
import { ServiceViewModel } from '../models/service';
|
||||
|
||||
angular.module('portainer.docker').factory('ServiceService', [
|
||||
'$q',
|
||||
'Service',
|
||||
'ServiceHelper',
|
||||
'TaskService',
|
||||
'ResourceControlService',
|
||||
'LogHelper',
|
||||
function ServiceServiceFactory($q, Service, ServiceHelper, TaskService, ResourceControlService, LogHelper) {
|
||||
function ServiceServiceFactory($q, Service) {
|
||||
'use strict';
|
||||
var service = {};
|
||||
|
||||
|
@ -88,7 +85,7 @@ angular.module('portainer.docker').factory('ServiceService', [
|
|||
|
||||
Service.logs(parameters)
|
||||
.$promise.then(function success(data) {
|
||||
var logs = LogHelper.formatLogs(data.logs, { stripHeaders: true, withTimestamps: !!timestamps });
|
||||
var logs = formatLogs(data.logs, { stripHeaders: true, withTimestamps: !!timestamps });
|
||||
deferred.resolve(logs);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { formatLogs } from '../helpers/logHelper';
|
||||
import { TaskViewModel } from '../models/task';
|
||||
|
||||
angular.module('portainer.docker').factory('TaskService', [
|
||||
'$q',
|
||||
'Task',
|
||||
'LogHelper',
|
||||
function TaskServiceFactory($q, Task, LogHelper) {
|
||||
function TaskServiceFactory($q, Task) {
|
||||
'use strict';
|
||||
var service = {};
|
||||
|
||||
|
@ -54,7 +54,7 @@ angular.module('portainer.docker').factory('TaskService', [
|
|||
|
||||
Task.logs(parameters)
|
||||
.$promise.then(function success(data) {
|
||||
var logs = LogHelper.formatLogs(data.logs, { stripHeaders: true, withTimestamps: !!timestamps });
|
||||
var logs = formatLogs(data.logs, { stripHeaders: true, withTimestamps: !!timestamps });
|
||||
deferred.resolve(logs);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue