{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% import _self as helper %} {% block toolbar %} {% if collector.counterrors or collector.countdeprecations or collector.countwarnings %} {% set icon %} {% set status_color = collector.counterrors ? 'red' : 'yellow' %} {{ include('@WebProfiler/Icon/logger.svg') }} {{ collector.counterrors ?: (collector.countdeprecations + collector.countwarnings) }} {% endset %} {% set text %}
Errors {{ collector.counterrors|default(0) }}
Warnings {{ collector.countwarnings|default(0) }}
Deprecations {{ collector.countdeprecations|default(0) }}
{% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} {% block menu %} {{ include('@WebProfiler/Icon/logger.svg') }} Logs {% if collector.counterrors or collector.countdeprecations or collector.countwarnings %} {{ collector.counterrors ?: (collector.countdeprecations + collector.countwarnings) }} {% endif %} {% endblock %} {% block panel %}

Log Messages

{% if collector.logs is empty %}

No log messages available.

{% else %} {# sort collected logs in groups #} {% set deprecation_logs, debug_logs, info_and_error_logs, silenced_logs = [], [], [], [] %} {% set has_error_logs = false %} {% for log in collector.logs %} {% if log.scream is defined and not log.scream %} {% set deprecation_logs = deprecation_logs|merge([log]) %} {% elseif log.scream is defined and log.scream %} {% set silenced_logs = silenced_logs|merge([log]) %} {% elseif log.priorityName == 'DEBUG' %} {% set debug_logs = debug_logs|merge([log]) %} {% else %} {% set info_and_error_logs = info_and_error_logs|merge([log]) %} {% if log.priorityName != 'INFO' %} {% set has_error_logs = true %} {% endif %} {% endif %} {% endfor %}

Info. & Errors {{ collector.counterrors ?: info_and_error_logs|length }}

Informational and error log messages generated during the execution of the application.

{% if info_and_error_logs is empty %}

There are no log messages of this level.

{% else %} {{ helper.render_table(info_and_error_logs, 'info', true) }} {% endif %}
{# 'deprecation_logs|length' is not used because deprecations are now grouped and the group count doesn't match the message count #}

Deprecations {{ collector.countdeprecations|default(0) }}

Log messages generated by using features marked as deprecated.

{% if deprecation_logs is empty %}

There are no log messages about deprecated features.

{% else %} {{ helper.render_table(deprecation_logs, 'deprecation', false, true) }} {% endif %}

Debug {{ debug_logs|length }}

Unimportant log messages generated during the execution of the application.

{% if debug_logs is empty %}

There are no log messages of this level.

{% else %} {{ helper.render_table(debug_logs, 'debug') }} {% endif %}

PHP Notices {{ collector.countscreams|default(0) }}

Log messages generated by PHP notices silenced with the @ operator.

{% if silenced_logs is empty %}

There are no log messages of this level.

{% else %} {{ helper.render_table(silenced_logs, 'silenced') }} {% endif %}
{% set compilerLogTotal = 0 %} {% for logs in collector.compilerLogs %} {% set compilerLogTotal = compilerLogTotal + logs|length %} {% endfor %}

Container {{ compilerLogTotal }}

Log messages generated during the compilation of the service container.

{% if collector.compilerLogs is empty %}

There are no compiler log messages.

{% else %} {% for class, logs in collector.compilerLogs %} {% endfor %}
Class Messages
{% set context_id = 'context-compiler-' ~ loop.index %} {{ class }}
    {% for log in logs %}
  • {{ profiler_dump_log(log.message) }}
  • {% endfor %}
{{ logs|length }}
{% endif %}
{% endif %} {% endblock %} {% macro render_table(logs, category = '', show_level = false, is_deprecation = false) %} {% import _self as helper %} {% set channel_is_defined = (logs|first).channel is defined %} {% set filter = show_level or channel_is_defined %} {% if show_level %}{% else %}{% endif %} {% if channel_is_defined %}{% endif %} {% for log in logs %} {% set css_class = is_deprecation ? '' : log.priorityName in ['CRITICAL', 'ERROR', 'ALERT', 'EMERGENCY'] ? 'status-error' : log.priorityName == 'WARNING' ? 'status-warning' %} {% if channel_is_defined %} {% endif %} {% endfor %}
LevelTimeChannelMessage
{% if show_level %} {{ log.priorityName }} {% endif %} {% if log.channel is null %}n/a{% else %}{{ log.channel }}{% endif %} {% if log.errorCount is defined and log.errorCount > 1 %} ({{ log.errorCount }} times) {% endif %} {{ helper.render_log_message(category, loop.index, log) }}
{% endmacro %} {% macro render_log_message(category, log_index, log) %} {% set has_context = log.context is defined and log.context is not empty %} {% set has_trace = log.context.exception.trace is defined %} {% if not has_context %} {{ profiler_dump_log(log.message) }} {% else %} {{ profiler_dump_log(log.message, log.context) }}
{% set context_id = 'context-' ~ category ~ '-' ~ log_index %} Show context {% if has_trace %}    {% set trace_id = 'trace-' ~ category ~ '-' ~ log_index %} Show trace {% endif %}
{{ profiler_dump(log.context, maxDepth=1) }}
{% if has_trace %}
{{ profiler_dump(log.context.exception.trace, maxDepth=1) }}
{% endif %} {% endif %} {% endmacro %}