diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index 373233afa8..6e92022a44 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -224,31 +224,33 @@ {% endmacro %} {% macro render_log_message(category, log_index, log) %} - {% if log.context.exception.trace is defined %} + {% 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 %} +
+ {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} + Show context - - Show trace + {% 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) }}
- - {% elseif log.context is defined and log.context is not empty %} - {{ profiler_dump_log(log.message, log.context) }} - - {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} - - - Show context - -
- {{ profiler_dump(log.context, maxDepth=1) }} -
-
- {% else %} - {{ profiler_dump_log(log.message) }} + {% endif %} {% endif %} {% endmacro %}