Find all files and directories in the current directory and its subdirectories (up to a maximum depth of 2) that are not empty and for each of them create a file named after the directory with the extension .log.
find ./ -maxdepth 2 ! -empty | xargs -I {} touch {}/{}.log