Yes, you can cut a log lengthwise with a chainsaw; you just need to ensure that you follow safety guidelines and that you are extremely careful, as this will take a lot of strength to accomplish. You need to ensure that you are using the right chainsaw, too, as some chainsaws do not have the power or may not be sharp enough to cut through a log lengthwise.  Ensure you are working on a stable surface and that you are clear from any potential obstacles. Place the log on some support to give you space and not cut into the ground. Mark your log down the middle to ensure you cut straight, then carefully start cutting with your chainsaw.