Comments (6)
As a temporary workaround, for anyone that needs it, re-defining the service in your application's ownservices.xml
file overwrites the broadway definition and seems to work.
<service id="broadway.auditing.command_logger" class="Broadway\Auditing\CommandLogger">
<argument type="service" id="monolog.logger" />
<argument type="service" id="broadway.auditing.serializer" />
<tag name="broadway.event_listener" event="broadway.command_handling.command_success" method="onCommandHandlingSuccess" />
<tag name="broadway.event_listener" event="broadway.command_handling.command_failure" method="onCommandHandlingFailure" />
</service>
Though I don't know that there are guarantees that that's always a the case or if it just depends on the order in which Symfony manages to rebuild the service container (i,e., I don't know if there's a defined processing order or if it's possible that your services.xml could be parsed first then overwritten by the Broadway definition).
from broadway.
Actually, it is dynamically injected: https://github.com/qandidate-labs/broadway/blob/master/src/Broadway/Bundle/BroadwayBundle/DependencyInjection/BroadwayExtension.php#L46-L59
So with logger: false
, it should fallback to simple_command_bus.
I agree that you will end up with a non-working (and by default non-used) service with logging disabled, so we might need to remove that service in the else
.
from broadway.
Ah, didn't dig down and see that it was dynamically created. Not so worried about it being non-used, however I did have logger set to false and it caused Symfony to hork. When I get some time this weekend, I'll see if I can dig further
from broadway.
Setting logger: true
yields:
The service "broadway.auditing.command_logger" has a dependency on a non-existent service "1".
Edit: I'm guessing it needs an actual class/service instead of just true
Setting logger:false
yields:
Catchable Fatal Error: Argument 1 passed to Broadway\Auditing\CommandLogger::__construct() must implement interface Psr\Log\LoggerInterface, string given, called in /Users/mbadolato/development/projects/example-symfony-ddd/var/cache/dev/appDevDebugProjectContainer.php on line 1078 and defined
config:
broadway:
command_handling:
logger: false
read_model:
repository: elasticsearch
elasticsearch:
hosts:
- localhost:9200
saga:
repository: in_memory
from broadway.
ok, so logger: false
doesn't work for me, but using the name of the monolog logger service ('logger') works. Was giving me fits; I had mistakenly tried to set it with the service "@logger" 😄
broadway:
command_handling:
logger: logger
from broadway.
Yes, it uses the value (when not falsey) as a direct reference, so no '@' required. As we use XML the @ probably wouldn't have worked in any situation :-)
We use this configuration in our application:
broadway:
command_handling:
logger: monolog.logger.commandlog
I agree this isn't the prettiest solution, but mainly a matter of missing documentation. Closing this for now.
from broadway.
Related Issues (20)
- drop test/Broadway/TestCase
- make PHPUnit a dependency HOT 5
- test the test helpers with examples HOT 2
- Built-in asynchronous way to run processors? HOT 3
- Example/explanation on event sourcing for aggregate roots HOT 1
- What is the overall state of the project? Is it GDPR ready? HOT 2
- Simple Command Bus - Manage Throwable exceptions
- Could you do a new release? HOT 2
- Are there any plans to update broadway? HOT 1
- Asymmetry between EventBus interface and EventListener interface HOT 2
- Broadway does not seem to survive hot upgrades HOT 2
- duck-typing vs interface HOT 1
- Replaying events to rebuild elastic search index HOT 1
- PHP 8 support HOT 2
- Processor after projector HOT 2
- Aggregator HOT 3
- Indirect development dependency used in src ConcurrencyConflictResolvers
- no recent tags? HOT 1
- Get uncommitted events without empty the aggregate HOT 4
- Give serializers flexibility to map based on event type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from broadway.