Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,32 @@
</service>

<service id="cache.adapter.apcu" class="Symfony\Component\Cache\Adapter\ApcuAdapter" abstract="true">
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- namespace -->
<argument /> <!-- default lifetime -->
<call method="setLogger">
<argument type="service" id="logger" on-invalid="ignore" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does on-invalid="ignore" make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that the way to say "this service does not need to exist", i.e. it is optional?

Copy link
Member Author

@nicolas-grekas nicolas-grekas Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on-invalid="ignore" is mandatory because the tag is not handled by the FrameworkBundle but by the MonologBundle, which is not a hard dep of it. This attribute (or its "null" variant) is used everywhere monlog.logger already is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, you're right.

</call>
</service>

<service id="cache.adapter.doctrine" class="Symfony\Component\Cache\Adapter\DoctrineAdapter" abstract="true">
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- Doctrine provider service -->
<argument /> <!-- namespace -->
<argument /> <!-- default lifetime -->
<call method="setLogger">
<argument type="service" id="logger" on-invalid="ignore" />
</call>
</service>

<service id="cache.adapter.filesystem" class="Symfony\Component\Cache\Adapter\FilesystemAdapter" abstract="true">
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- namespace -->
<argument /> <!-- default lifetime -->
<argument>%kernel.cache_dir%/pools</argument>
<call method="setLogger">
<argument type="service" id="logger" on-invalid="ignore" />
</call>
</service>

<service id="cache.adapter.psr6" class="Symfony\Component\Cache\Adapter\ProxyAdapter" abstract="true">
Expand All @@ -53,9 +65,13 @@
</service>

<service id="cache.adapter.redis" class="Symfony\Component\Cache\Adapter\RedisAdapter" abstract="true">
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- Redis connection object -->
<argument /> <!-- namespace -->
<argument /> <!-- default lifetime -->
<call method="setLogger">
<argument type="service" id="logger" on-invalid="ignore" />
</call>
</service>

</services>
Expand Down