Is it possible to return data/models from controller to template via setRouteVariables?
I believe you are overwriting the log variable you are sending back to the template when you set log equal to the response of getPost.

From what I can see of your code, when you return variables to your template via setRouteVariables, you should be providing the variables you define in that array to your template, without having to take a second step and retrieve them.  So, when your controller returns:

craft()-&gt;urlManager-&gt;setRouteVariables(array(
   'log' =&gt; $log
));


You should then be able to access that variable in your template if it exists:

{% if log is defined %}
    {{ dump(log) }}
{% endif %}




setRouteVariables adds your variables to Twig's context, which you can see in your template by dumping _context:

{{ dump(_context) }}


Or, a handy way to just see the variables available in the context and not the full models is using the keys filter:

{{ dump(_context|keys) }}




In your case, I believe when your page reloads, your log variable is available, but then you set it to null when you try to retrieve it.

Your current code:

{# Sets log to null, because no post variable exists named `log` #}
{% set log = craft.request.getPost('log') %}

{% if log is defined %}
    {{ dump(log) }} {# outputs null #}
{% endif %}


Try outputting the log variable before setting your getPost value:

{# Outputs log if it exists in Twig's context #}
{% if log is defined %}
    {{ dump(log) }} {# will probably output your value #}
{% endif %}

{# Delete this. It just overwrites your existing log variable #}
{% set log = craft.request.getPost('log') %}