Custom Yii Log Target class

Where in yii application structure is best place to create custom class like new log target, and other not controller, model or views ?

Yii2 doesn’t particularly impose any structure for this.

You can use components as a general collection of local classes, similar to Yii1 if you like. I recommend this if you will only have a few additional classes.

If you will have many, then I suggest you replicate the structure in the yii module. So widgets, helpers, log, behaviors, etc. would contain appropriate classes.

Hope that helps.