Add Behaviors To Models Via Di?

Would it be possible to add eg. a logging behavior to a model from an extension by configuration or dependency injection?

From my understandig ( it should be possible, but maybe someone has tried this already and can share his thoughts.

via DI one can set property values to a class name.

But you will have to create your model object via Yii::createObject

And what’s about registering a command from an extension for example?

Can I set an application property via DI?