You could extend the default logger in scrapy to output whatever you want. Alternatively, you could just manually write log messages to standard out to say whatever you want. It's all in the manual.
http://doc.scrapy.org/en/latest/topics/logging.html On Tue, Mar 3, 2015 at 10:06 PM, Gopi Krishnan R <[email protected]> wrote: > Hi All, > > I asked this question in stackoverflow, but posting it here also in hope > of a response. Kindly let me know if there is a way to do this. > > > I would like to modify the scrapy log messages to contain user id at the > beginning of it. for example, instead of this > > 2015-03-03 17:09:34+0530 [scrapy] INFO: Enabled spider middlewares: > HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, > UrlLengthMiddleware, DepthMiddleware > > Is it possible to make it appear like > > **user_id**:2015-03-03 17:09:34+0530 [scrapy] INFO: Enabled spider > middlewares: HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, > UrlLengthMiddleware, DepthMiddleware > > Additionaly, is there a way to log only the user messages; i.e, Log only > the messages I want logged which I will supply from the code? > > Any help would be greatly appreciated. Thanks in advance! > > > Thanks, > > Gopi > > -- > You received this message because you are subscribed to the Google Groups > "scrapy-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/scrapy-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "scrapy-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/scrapy-users. For more options, visit https://groups.google.com/d/optout.
