Are you saying you want the lens flare to only appear inside the logo? I might use the Preserve Transparency layer switch for that, but the details of your comp may demand another solution. In other cases using an Alpha Track Matte or Set Matte with a pre-comp of your logo animation would probably work.
If that's not what you're after can you please try to explain it again and spell out in detail what it is you currently have versus what you'd like to have.