Depends on the size of your logs. If the chink line is 3/4” or less you need to use Energy Seal caulk and it needs to be done before staining. DO NOT use paint. If you want the painted look use Sherwin Williams Woodscapes solid.
If the lines are wider, then use true chinking (Perma Chink) and it can be done before or after, depends on the look you want. If you have a kit style log house DO NOT use true chinking. It cannot put up with the movement of the house with such a small line and will crack.